Refine search
@Override public void readFields(DataInput in) throws IOException { this.bytes = new byte[in.readInt()]; in.readFully(this.bytes); weight = in.readDouble(); }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { super.fromData(in); this.timestamp = in.readLong(); this.changeCount = in.readInt(); this.listenerIds = new int[this.changeCount]; this.values = new double[this.changeCount]; for (int i = 0; i < this.changeCount; i++) { this.listenerIds[i] = in.readInt(); this.values[i] = in.readDouble(); } }
private Object readFieldValue(DataInput input) throws IOException { int type = input.readByte(); switch (type) { case 0: return null; case 1: return input.readInt(); case 2: return input.readLong(); case 3: return input.readFloat(); case 4: return input.readDouble(); case 5: return input.readUTF(); default: throw new RuntimeException("Unexpected field value type: " + type); } }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.avg20DaysVol = in.readLong(); this.bondRating = DataSerializer.readString(in); this.convRatio = in.readDouble(); this.country = DataSerializer.readString(in); this.delta = in.readDouble(); this.industry = in.readLong(); this.issuer = in.readLong(); this.mktValue = in.readDouble(); this.qty = in.readDouble(); this.secId = DataSerializer.readString(in); this.secIdIndexed = DataSerializer.readString(in); this.secLinks = DataSerializer.readString(in); this.sharesOutstanding = in.readDouble(); this.underlyer = DataSerializer.readString(in); this.volatility = in.readLong(); this.pid = in.readInt(); this.portfolioId = in.readInt(); }
values[i] = data.readInt(); break; values[i] = data.readDouble(); ++i; break; case INTERFACEMETHODREF : case NAMEANDTYPE : values[i] = data.readInt(); break; default:
case TYPE_BYTE: return (T)(Byte)in.readByte(); case TYPE_CHAR: return (T)(Character)in.readChar(); case TYPE_DOUBLE: return (T)(Double)in.readDouble(); case TYPE_FLOAT: return (T)(Float)in.readFloat(); case TYPE_INT: return (T)(Integer)in.readInt(); case TYPE_LONG: return (T)(Long)in.readLong(); case TYPE_SHORT: return (T)(Short)in.readShort(); case TYPE_STRING: int str_len=in.readInt(); if(str_len == 0) return (T)""; byte[] tmp=new byte[str_len]; return (T)in.readUTF(); case TYPE_BYTEARRAY: int len=in.readInt(); byte[] tmpbuf=new byte[len]; in.readFully(tmpbuf,0,tmpbuf.length);
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); createVector(); for (int i = 0; i < fpVector.length; i++) { List<Key> list = fpVector[i]; int size = in.readInt(); for (int j = 0; j < size; j++) { Key k = new Key(); k.readFields(in); list.add(k); } } for (int i = 0; i < keyVector.length; i++) { List<Key> list = keyVector[i]; int size = in.readInt(); for (int j = 0; j < size; j++) { Key k = new Key(); k.readFields(in); list.add(k); } } for (int i = 0; i < ratio.length; i++) { ratio[i] = in.readDouble(); } } }
instance = Short.valueOf(in.readShort()); } else if (declaredClass == Integer.TYPE) { // int instance = Integer.valueOf(in.readInt()); } else if (declaredClass == Long.TYPE) { // long instance = Long.valueOf(in.readLong()); instance = Float.valueOf(in.readFloat()); } else if (declaredClass == Double.TYPE) { // double instance = Double.valueOf(in.readDouble()); } else if (declaredClass == Void.TYPE) { // void instance = null; int length = in.readInt(); instance = Array.newInstance(declaredClass.getComponentType(), length); for (int i = 0; i < length; i++) {
public void testReadLittleEndian() throws IOException { DataInput in = new LittleEndianDataInputStream(new ByteArrayInputStream(data)); /* Read in various values in LITTLE ENDIAN FORMAT */ byte[] b = new byte[2]; in.readFully(b); assertEquals(-100, b[0]); assertEquals(100, b[1]); assertEquals(true, in.readBoolean()); assertEquals(false, in.readBoolean()); assertEquals(100, in.readByte()); assertEquals(-100, in.readByte()); assertEquals(200, in.readUnsignedByte()); assertEquals('\u6100', in.readChar()); assertEquals(-12150, in.readShort()); assertEquals(20675, in.readUnsignedShort()); assertEquals(0xBEBAFECA, in.readInt()); assertEquals(0xBEBAFECAEFBEADDEL, in.readLong()); assertEquals("Herby Derby", in.readUTF()); assertEquals(0xBEBAFECA, Float.floatToIntBits(in.readFloat())); assertEquals(0xBEBAFECAEFBEADDEL, Double.doubleToLongBits(in.readDouble())); }
private RuntimeConstant readRuntimeConstant(DataInput input) throws IOException { byte kind = input.readByte(); switch (kind) { case 0: return new RuntimeConstant(input.readInt()); case 1: return new RuntimeConstant(input.readLong()); case 2: return new RuntimeConstant(input.readFloat()); case 3: return new RuntimeConstant(input.readDouble()); case 4: return new RuntimeConstant(input.readUTF()); case 5: return new RuntimeConstant(parseValueType(symbolTable.at(input.readInt()))); case 6: return new RuntimeConstant(MethodDescriptor.parseSignature(symbolTable.at(input.readInt()))); case 7: return new RuntimeConstant(readMethodHandle(input)); default: throw new IllegalArgumentException("Unexpected runtime constant type: " + kind); } }
return new AnnotationValue(input.readByte()); case AnnotationValue.CLASS: return new AnnotationValue(ValueType.parse(symbolTable.at(input.readInt()))); case AnnotationValue.DOUBLE: return new AnnotationValue(input.readDouble()); case AnnotationValue.ENUM: { String className = symbolTable.at(input.readInt()); String fieldName = symbolTable.at(input.readInt()); return new AnnotationValue(new FieldReference(className, fieldName));
byte[] buffer = new byte[in.readInt()]; in.readFully(buffer); return new String(buffer, UTF8); return in.readDouble(); int len = in.readInt(); byte[] ba = new byte[len]; in.readFully(ba); int size = in.readInt(); Map<Object, Object> m = new LinkedHashMap<Object, Object>(size); for (int i = 0; i < size; i++) {
@Override public Object fromData(DataInput in) throws IOException, ClassNotFoundException { byte classId = in.readByte(); assertEquals(CLASS_ID, classId); NonDataSerializable nds = new NonDataSerializable(); nds.intValue = in.readInt(); nds.doubleValue = in.readDouble(); nds.stringValue = in.readUTF(); nds.dsValue = (DataSerializable) readObject(in); nds.serValue = (Serializable) readObject(in); nds.objectValue = readObject(in); return nds; } }
assertEquals(-12150, in.readShort()); assertEquals(20675, in.readUnsignedShort()); assertEquals(0xBEBAFECA, in.readInt()); assertEquals(0xBEBAFECAEFBEADDEL, in.readLong()); assertEquals("Herby Derby", in.readUTF()); assertEquals(0xBEBAFECA, Float.floatToIntBits(in.readFloat())); assertEquals(0xBEBAFECAEFBEADDEL, Double.doubleToLongBits(in.readDouble()));
assertEquals(-1, in.readShort()); assertEquals(0, in.readShort()); assertEquals(Integer.MAX_VALUE, in.readInt()); assertEquals(Integer.MIN_VALUE, in.readInt()); assertEquals(-1, in.readInt()); assertEquals(0, in.readInt()); assertEquals(1, in.readInt()); assertEquals(Float.NEGATIVE_INFINITY, in.readFloat()); assertEquals(Float.NaN, in.readFloat()); assertEquals(-12312312.3333333336666779, in.readDouble()); assertEquals(123123.234, in.readDouble()); assertEquals(Double.MAX_VALUE, in.readDouble()); assertEquals(Double.MIN_VALUE, in.readDouble()); assertEquals(Double.MIN_NORMAL, in.readDouble()); assertEquals(Double.NEGATIVE_INFINITY, in.readDouble()); assertEquals(Double.POSITIVE_INFINITY, in.readDouble()); assertEquals(Double.NaN, in.readDouble()); assertEquals(Long.MAX_VALUE, in.readLong()); assertEquals(Long.MIN_VALUE, in.readLong());
ClassConstantInstruction insn = new ClassConstantInstruction(); insn.setReceiver(program.variableAt(input.readShort())); insn.setConstant(parseValueType(symbolTable.at(input.readInt()))); return insn; IntegerConstantInstruction insn = new IntegerConstantInstruction(); insn.setReceiver(program.variableAt(input.readShort())); insn.setConstant(input.readInt()); return insn; DoubleConstantInstruction insn = new DoubleConstantInstruction(); insn.setReceiver(program.variableAt(input.readShort())); insn.setConstant(input.readDouble()); return insn; CastInstruction insn = new CastInstruction(); insn.setReceiver(program.variableAt(input.readShort())); insn.setTargetType(parseValueType(symbolTable.at(input.readInt()))); insn.setValue(program.variableAt(input.readShort())); return insn;
expr.setValue(input.readInt()); return expr; expr.setValue(input.readDouble()); return expr; expr.setValue(ValueType.parse(symbolTable.at(input.readInt()))); return expr; case 17: { QualificationExpr expr = new QualificationExpr(); String className = symbolTable.at(input.readInt()); String fieldName = symbolTable.at(input.readInt()); expr.setField(new FieldReference(className, fieldName));
break; case ConstantInfo.TAG_INTEGER: constant = new ConstantIntegerInfo(din.readInt()); break; case ConstantInfo.TAG_FLOAT: break; case ConstantInfo.TAG_DOUBLE: constant = new ConstantDoubleInfo(din.readDouble()); entryCount++; break;
@Override public double[] readDoubleArray(DataInput in) throws IOException { int len = in.readInt(); double[] doubles = new double[len]; for (int i = 0; i < len; i++) { doubles[i] = in.readDouble(); } return doubles; }
@Override public void readFields(DataInput in) throws IOException { this.key = in.readInt(); this.value = in.readDouble(); }