public static void marshalPrimitiveList(List list, DataByteArrayOutputStream out) throws IOException { out.writeInt(list.size()); for (Iterator iter = list.iterator(); iter.hasNext();) { Object element = (Object) iter.next(); marshalPrimitive(out, element); } }
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.length); dataOut.write(data); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { Response info = (Response)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getCorrelationId()); } }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); IntegerResponse info = (IntegerResponse)o; dataOut.writeInt(info.getResult()); }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { IntegerResponse info = (IntegerResponse)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getResult()); } }
public static void marshalByteArray(DataByteArrayOutputStream out, byte[] value, int offset, int length) throws IOException { out.writeByte(BYTE_ARRAY_TYPE); out.writeInt(length); out.write(value, offset, length); }
protected void tightMarshalByteArray2(byte[] data, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { dataOut.writeInt(data.length); dataOut.write(data); } }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); Response info = (Response)o; dataOut.writeInt(info.getCorrelationId()); }
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.length); dataOut.write(data); } }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); IntegerResponse info = (IntegerResponse)o; dataOut.writeInt(info.getResult()); }
private void writePageFileHeader(int freePageExtent) throws IOException { DataByteArrayOutputStream os = new DataByteArrayOutputStream(); os.write(HAWT_DB_PAGE_FILE_MAGIC); os.writeInt(freePageExtent); os.writeInt(headerSize); os.writeShort(pageSize); os.close(); mappedFileFactory.getMemoryMappedFile().write(0, os.toBuffer()); }
public int hashNode(N node, int i) { try { DataByteArrayOutputStream os = new DataByteArrayOutputStream(); nodeCodec.encode(node, os); os.write(':'); os.writeInt(i); return hash(os.toBuffer()); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { BaseCommand info = (BaseCommand)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getCommandId()); dataOut.writeBoolean(info.isResponseRequired()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { NetworkBridgeFilter info = (NetworkBridgeFilter)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getNetworkTTL()); looseMarshalCachedObject(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { PartialCommand info = (PartialCommand)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getCommandId()); looseMarshalByteArray(wireFormat, info.getData(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { NetworkBridgeFilter info = (NetworkBridgeFilter)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getNetworkTTL()); looseMarshalCachedObject(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut); } }
protected void tightMarshalBuffer2(Buffer data, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { dataOut.writeInt(data.getLength()); dataOut.write(data.getData(), data.getOffset(), data.getLength()); } }
protected void looseMarshalBuffer(OpenWireFormat wireFormat, Buffer data, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.getLength()); dataOut.write(data.getData(), data.getOffset(), data.getLength()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { WireFormatInfo info = (WireFormatInfo)o; info.beforeMarshall(wireFormat); super.looseMarshal(wireFormat, o, dataOut); looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8); dataOut.writeInt(info.getVersion()); looseMarshalBuffer(wireFormat, info.getMarshalledProperties(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { MessageDispatch info = (MessageDispatch)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessage(), dataOut); dataOut.writeInt(info.getRedeliveryCounter()); } }