HornetQBuffer buffer = serverMessage.getBodyBufferCopy();
int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex()
: serverMessage.getEndOfBodyPosition();
int size = bodyPos - buffer.readerIndex();
buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE + DataConstants.SIZE_INT);
byte[] data = new byte[size];
if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH) || serverMessage.getType() == Message.BYTES_TYPE)
{
headers.put(Headers.CONTENT_LENGTH, data.length);