protected byte[] tightUnmarshalByteArray(DataInput dataIn, BooleanStream bs) throws IOException { byte rc[] = null; if (bs.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }
protected void tightMarshalByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { dataOut.writeInt(data.length); dataOut.write(data); } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setBrowser(bs.readBoolean()); info .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject( dataIn, bs)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(bs.readBoolean()); info.setSelector(tightUnmarshalString(dataIn, bs)); info.setSubscriptionName(tightUnmarshalString(dataIn, bs)); info.setNoLocal(bs.readBoolean()); info.setExclusive(bs.readBoolean()); info.setRetroactive(bs.readBoolean()); info.setPriority(dataIn.readByte()); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for (int i = 0; i < size; i++) { dataIn, bs)); info.setNetworkSubscription(bs.readBoolean()); info.setOptimizedAcknowledge(bs.readBoolean()); info.setNoRangeAcks(bs.readBoolean());
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); DestinationInfo info = (DestinationInfo)o; info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setOperationType(dataIn.readByte()); info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for( int i=0; i < size; i++ ) { value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } }
public DataStructure tightUnmarshalNestedObject(DataInput dis, BooleanStream bs) throws IOException { if (bs.readBoolean()) { byte dataType = dis.readByte(); DataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF]; if (dsm == null) { throw new IOException("Unknown data type: " + dataType); } DataStructure data = dsm.createObject(); if (data.isMarshallAware() && bs.readBoolean()) { dis.readInt(); dis.readByte(); BooleanStream bs2 = new BooleanStream(); bs2.unmarshal(dis); dsm.tightUnmarshal(this, data, dis, bs2); // TODO: extract the sequence from the dis and associate it. // MarshallAware ma = (MarshallAware)data // ma.setCachedMarshalledForm(this, sequence); } else { dsm.tightUnmarshal(this, data, dis, bs); } return data; } else { return null; } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); JournalTransaction info = (JournalTransaction)o; info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setType(dataIn.readByte()); info.setWasPrepared(bs.readBoolean()); }
protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (wireFormat.isCacheEnabled()) { if (bs.readBoolean()) { short index = dataIn.readShort(); DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs); wireFormat.setInUnmarshallCache(index, object); return object; } else { short index = dataIn.readShort(); return wireFormat.getFromUnmarshallCache(index); } } else { return wireFormat.tightUnmarshalNestedObject(dataIn, bs); } }
info.setBrowser(bs.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(bs.readBoolean()); info.setSelector(tightUnmarshalString(dataIn, bs)); info.setSubscriptionName(tightUnmarshalString(dataIn, bs)); info.setNoLocal(bs.readBoolean()); info.setExclusive(bs.readBoolean()); info.setRetroactive(bs.readBoolean()); info.setPriority(dataIn.readByte()); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for( int i=0; i < size; i++ ) { info.setNetworkSubscription(bs.readBoolean()); info.setOptimizedAcknowledge(bs.readBoolean()); info.setNoRangeAcks(bs.readBoolean()); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.ConsumerId value[] = new org.apache.activemq.command.ConsumerId[size]; for( int i=0; i < size; i++ ) {
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }
protected byte[] tightUnmarshalByteArray(DataInput dataIn, BooleanStream bs) throws IOException { byte rc[] = null; if (bs.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }
protected void tightMarshalByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { dataOut.writeInt(data.length); dataOut.write(data); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); DestinationInfo info = (DestinationInfo)o; info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setOperationType(dataIn.readByte()); info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for( int i=0; i < size; i++ ) { value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); JournalTransaction info = (JournalTransaction)o; info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setType(dataIn.readByte()); info.setWasPrepared(bs.readBoolean()); }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (wireFormat.isCacheEnabled()) { if (bs.readBoolean()) { short index = dataIn.readShort(); DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs); wireFormat.setInUnmarshallCache(index, object); return object; } else { short index = dataIn.readShort(); return wireFormat.getFromUnmarshallCache(index); } } else { return wireFormat.tightUnmarshalNestedObject(dataIn, bs); } }
info.setBrowser(bs.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(bs.readBoolean()); info.setSelector(tightUnmarshalString(dataIn, bs)); info.setSubscriptionName(tightUnmarshalString(dataIn, bs)); info.setNoLocal(bs.readBoolean()); info.setExclusive(bs.readBoolean()); info.setRetroactive(bs.readBoolean()); info.setPriority(dataIn.readByte()); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for( int i=0; i < size; i++ ) { info.setNetworkSubscription(bs.readBoolean()); info.setOptimizedAcknowledge(bs.readBoolean()); info.setNoRangeAcks(bs.readBoolean()); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.ConsumerId value[] = new org.apache.activemq.command.ConsumerId[size]; for( int i=0; i < size; i++ ) {
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }
protected byte[] tightUnmarshalByteArray(DataInput dataIn, BooleanStream bs) throws IOException { byte rc[] = null; if (bs.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }