return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
}
public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException {
ByteArrayInputStream is = new ByteArrayInputStream(bytes, offset, len);
ObjectInput in = startObjectInput(is, false);
Object o = null;
try {
o = defaultMarshaller.objectFromObjectStream(in);
} finally {
finishObjectInput(in);