public static void marshalBoolean(DataByteArrayOutputStream dataOut, boolean value) throws IOException { dataOut.writeByte(BOOLEAN_TYPE); dataOut.writeBoolean(value); }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { ConnectionControl info = (ConnectionControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); dataOut.writeBoolean(info.isExit()); dataOut.writeBoolean(info.isFaultTolerant()); dataOut.writeBoolean(info.isResume()); dataOut.writeBoolean(info.isSuspend()); } }
public void encodeResponse(ClassLoader loader, Class<?> type, Object value, Throwable error, DataByteArrayOutputStream target) throws IOException, ClassNotFoundException { if( error!=null ) { target.writeBoolean(true); target.writeUTF(error.getClass().getName()); target.writeUTF(error.getMessage()); } else { target.writeBoolean(false); encodeProtobuf(type, value, target); } }
public void encodeResponse(ClassLoader loader, Class<?> type, Object value, Throwable error, DataByteArrayOutputStream target) throws IOException, ClassNotFoundException { if( error!=null ) { target.writeBoolean(true); target.writeUTF(error.getClass().getName()); target.writeUTF(error.getMessage()); } else { target.writeBoolean(false); encodeProtobuf(type, value, target); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException { ConnectionControl info = (ConnectionControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); dataOut.writeBoolean(info.isExit()); dataOut.writeBoolean(info.isFaultTolerant()); dataOut.writeBoolean(info.isResume()); dataOut.writeBoolean(info.isSuspend()); } }
protected void looseMarshalString(UTF8Buffer value, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeShort(value.length); dataOut.write(value); } }
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); } }
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); } }
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(objects != null); if (objects != null) { dataOut.writeShort(objects.length); for (int i = 0; i < objects.length; i++) { looseMarshalNestedObject(wireFormat, objects[i], dataOut); } } }
protected void looseMarshalString(UTF8Buffer value, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeShort(value.length); dataOut.write(value); } }
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataByteArrayOutputStream dataOut) throws IOException { dataOut.writeBoolean(objects != null); if (objects != null) { dataOut.writeShort(objects.length); for (int i = 0; i < objects.length; i++) { looseMarshalNestedObject(wireFormat, objects[i], dataOut); } } }
/** * 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 { BaseCommand info = (BaseCommand)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeInt(info.getCommandId()); dataOut.writeBoolean(info.isResponseRequired()); } }
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 { ConsumerControl info = (ConsumerControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeInt(info.getPrefetch()); } }
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 { ConsumerControl info = (ConsumerControl)o; super.looseMarshal(wireFormat, o, dataOut); dataOut.writeBoolean(info.isClose()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeInt(info.getPrefetch()); } }
private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException { DataByteArrayOutputStream mos = new DataByteArrayOutputStream(); mos.writeBoolean(TIGHT_ENCODING); mos.writeVarInt(OPENWIRE_VERSION); wireformat.marshal(message, mos); MessagePB.Bean messageRecord = new MessagePB.Bean(); messageRecord.setCodec(codec_id); messageRecord.setMessageKey(messageKey); messageRecord.setSize(message.getSize()); messageRecord.setValue(mos.toBuffer()); return messageRecord; }
private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException { DataByteArrayOutputStream mos = new DataByteArrayOutputStream(); mos.writeBoolean(TIGHT_ENCODING); mos.writeVarInt(OPENWIRE_VERSION); wireformat.marshal(message, mos); MessagePB.Bean messageRecord = new MessagePB.Bean(); messageRecord.setCodec(codec_id); messageRecord.setMessageKey(messageKey); messageRecord.setSize(message.getSize()); messageRecord.setValue(mos.toBuffer()); return messageRecord; }
private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException { DataByteArrayOutputStream mos = new DataByteArrayOutputStream(); mos.writeBoolean(TIGHT_ENCODING); mos.writeVarInt(OPENWIRE_VERSION); wireformat.marshal(message, mos); MessagePB.Bean messageRecord = new MessagePB.Bean(); messageRecord.setCodec(codec_id); messageRecord.setMessageKey(messageKey); messageRecord.setSize(message.getSize()); messageRecord.setValue(mos.toBuffer()); return messageRecord; }