git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@408776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-05-22 22:43:35 +00:00
parent deff26029f
commit d671875ebf
1 changed files with 7 additions and 3 deletions

View File

@ -234,10 +234,14 @@ final public class OpenWireFormat implements WireFormat {
size += dsm.tightMarshal1(this, c, bs); size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize(); size += bs.marshalledSize();
if( !sizePrefixDisabled ) {
dataOut.writeInt(size); dataOut.writeInt(size);
}
dataOut.writeByte(type); dataOut.writeByte(type);
bs.marshal(dataOut); bs.marshal(dataOut);
dsm.tightMarshal2(this, c, dataOut, bs); dsm.tightMarshal2(this, c, dataOut, bs);
} else { } else {
DataOutputStream looseOut = dataOut; DataOutputStream looseOut = dataOut;
ByteArrayOutputStream baos=null; ByteArrayOutputStream baos=null;
@ -253,7 +257,7 @@ final public class OpenWireFormat implements WireFormat {
if( !sizePrefixDisabled ) { if( !sizePrefixDisabled ) {
looseOut.close(); looseOut.close();
ByteSequence sequence = baos.toByteSequence(); ByteSequence sequence = baos.toByteSequence();
dataOut.writeInt(sequence.getLength()-4); dataOut.writeInt(sequence.getLength());
dataOut.write(sequence.getData(), sequence.getOffset(), sequence.getLength()); dataOut.write(sequence.getData(), sequence.getOffset(), sequence.getLength());
} }