Refine search
@Override public void write(DataOutput out) throws IOException { out.writeInt(bytes.length); out.write(bytes); out.writeDouble(weight); }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeLong(this.timestamp); out.writeInt(this.changeCount); for (int i = 0; i < this.changeCount; i++) { out.writeInt(this.listenerIds[i]); out.writeDouble(this.values[i]); } }
private void writeFieldValue(DataOutput output, Object value) throws IOException { if (value == null) { output.writeByte(0); } else if (value instanceof Integer) { output.writeByte(1); output.writeInt((Integer) value); } else if (value instanceof Long) { output.writeByte(2); output.writeLong((Long) value); } else if (value instanceof Float) { output.writeByte(3); output.writeFloat((Float) value); } else if (value instanceof Double) { output.writeByte(4); output.writeDouble((Double) value); } else if (value instanceof String) { output.writeByte(5); output.writeUTF((String) value); } }
@Override public void toData(DataOutput out) throws IOException { out.writeLong(this.avg20DaysVol); DataSerializer.writeString(this.bondRating, out); out.writeDouble(this.convRatio); DataSerializer.writeString(this.country, out); out.writeDouble(this.delta); out.writeLong(this.industry); out.writeLong(this.issuer); out.writeDouble(this.mktValue); out.writeDouble(this.qty); DataSerializer.writeString(this.secId, out); DataSerializer.writeString(this.secIdIndexed, out); DataSerializer.writeString(this.secLinks, out); out.writeDouble(this.sharesOutstanding); DataSerializer.writeString(this.underlyer, out); out.writeLong(this.volatility); out.writeInt(this.pid); out.writeInt(this.portfolioId); }
@Override public void visit(ConstantExpr expr) { try { Object value = expr.getValue(); if (value == null) { output.writeByte(3); } else if (value instanceof Integer) { output.writeByte(4); output.writeInt((Integer) value); } else if (value instanceof Long) { output.writeByte(5); output.writeLong((Long) value); } else if (value instanceof Float) { output.writeByte(6); output.writeFloat((Float) value); } else if (value instanceof Double) { output.writeByte(7); output.writeDouble((Double) value); } else if (value instanceof String) { output.writeByte(8); output.writeUTF((String) value); } else if (value instanceof ValueType) { output.writeByte(9); output.writeInt(symbolTable.lookup(value.toString())); } } catch (IOException e) { throw new IOExceptionWrapper(e); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); for (int i = 0; i < fpVector.length; i++) { List<Key> list = fpVector[i]; out.writeInt(list.size()); for (Key k : list) { k.write(out); } } for (int i = 0; i < keyVector.length; i++) { List<Key> list = keyVector[i]; out.writeInt(list.size()); for (Key k : list) { k.write(out); } } for (int i = 0; i < ratio.length; i++) { out.writeDouble(ratio[i]); } }
break; case TYPE_DOUBLE: out.writeDouble((Double)obj); break; case TYPE_FLOAT: break; case TYPE_INT: out.writeInt((Integer)obj); break; case TYPE_LONG: int len=str.length(); out.write(TYPE_STRING); out.writeInt(len); for(int i=0; i < len; i++) out.write((byte)str.charAt(i)); case TYPE_BYTEARRAY: byte[] buf=(byte[])obj; out.writeInt(buf.length); out.write(buf,0,buf.length); break;
out.writeInt(length); for (int i = 0; i < length; i++) { writeObject(out, Array.get(instance, i), out.writeShort(((Short)instance).shortValue()); } else if (declaredClass == Integer.TYPE) { // int out.writeInt(((Integer)instance).intValue()); } else if (declaredClass == Long.TYPE) { // long out.writeLong(((Long)instance).longValue()); out.writeFloat(((Float)instance).floatValue()); } else if (declaredClass == Double.TYPE) { // double out.writeDouble(((Double)instance).doubleValue()); } else if (declaredClass == Void.TYPE) { // void } else {
case RuntimeConstant.INT: output.writeByte(0); output.writeInt(cst.getInt()); break; case RuntimeConstant.LONG: case RuntimeConstant.DOUBLE: output.writeByte(3); output.writeDouble(cst.getDouble()); break; case RuntimeConstant.STRING: case RuntimeConstant.TYPE: output.writeByte(5); output.writeInt(symbolTable.lookup(cst.getValueType().toString())); break; case RuntimeConstant.METHOD: output.writeByte(6); output.writeInt(symbolTable.lookup(ValueType.methodTypeToString(cst.getMethodType()))); break; case RuntimeConstant.METHOD_HANDLE:
out.writeShort(65535); out.writeShort(65536); // 0 out.writeInt(Integer.MAX_VALUE); out.writeInt(Integer.MIN_VALUE); out.writeInt(-1); out.writeInt(0); out.writeInt(1); out.writeFloat(Float.NEGATIVE_INFINITY); out.writeFloat(Float.NaN); out.writeDouble(-12312312.3333333336666779); out.writeDouble(123123.234); out.writeDouble(Double.MAX_VALUE); out.writeDouble(Double.MIN_VALUE); out.writeDouble(Double.MIN_NORMAL); out.writeDouble(Double.NEGATIVE_INFINITY); out.writeDouble(Double.POSITIVE_INFINITY); out.writeDouble(Double.NaN); out.writeLong(Long.MAX_VALUE); out.writeLong(Long.MIN_VALUE);
List<?> list = (List<?>) val; int sz = list.size(); out.writeInt(sz); for (int i = 0; i < sz; i++) { writeDatum(out, list.get(i)); out.writeInt(m.size()); Iterator<?> i = m.entrySet().iterator(); out.writeDouble((Double) val); return; String s = (String) val; byte[] utfBytes = s.getBytes(ReaderWriter.UTF8); out.writeInt(utfBytes.length); out.write(utfBytes); return;
@Override public boolean toData(Object o, DataOutput out) throws IOException { if (o instanceof NonDataSerializable) { NonDataSerializable nds = (NonDataSerializable) o; out.writeByte(CLASS_ID); out.writeInt(nds.intValue); out.writeDouble(nds.doubleValue); out.writeUTF(nds.stringValue); writeObject(nds.dsValue, out); writeObject(nds.serValue, out); writeObject(nds.objectValue, out); return true; } else { return false; } }
case 0: out.writeByte(r.nextInt()); break; case 1: out.writeShort((short)(r.nextInt() & 0xFFFF)); break; case 2: out.writeInt(r.nextInt()); break; case 3: out.writeLong(r.nextLong()); break; case 4: out.writeDouble(r.nextDouble()); break; case 5: out.writeFloat(r.nextFloat()); break; case 6:
break; case AnnotationValue.CLASS: output.writeInt(symbolTable.lookup(value.getJavaClass().toString())); break; case AnnotationValue.DOUBLE: output.writeDouble(value.getDouble()); break; case AnnotationValue.ENUM: output.writeInt(symbolTable.lookup(value.getEnumValue().getClassName())); output.writeInt(symbolTable.lookup(value.getEnumValue().getFieldName())); break; case AnnotationValue.FLOAT:
@Override public void doWrite(DataOutput out) throws IOException { if(parameters != null) { out.writeInt(this.parameters.length); for(int i = 0; i < this.parameters.length; i++) { out.writeDouble(this.parameters[i]); } } out.writeDouble(this.error); }
@Override public void writeDoubleArray(double[] field, DataOutput data) throws IOException { data.writeInt(field.length); for (double d : field) data.writeDouble(d); }
/** * Writes a double[] into a DataOutput * @throws java.io.IOException */ public static void writeArray(DataOutput out, double[] array) throws IOException { out.writeInt(array.length); for (double value : array) { out.writeDouble(value); } }
@Override public void write(Object field, DataOutput data) throws IOException { data.writeInt(((double[]) field).length); for (double d : (double[]) field) data.writeDouble(d); } });
@Override public void write(DataOutput out) throws IOException { out.writeInt(length); for (int i = 0; i < length; i++) { out.writeDouble(array[i]); } }
@Override public void write(DataOutput out) throws IOException { out.writeInt(bytes.length); out.write(bytes); out.writeDouble(weight); }