public byte[] convert(EzyMessage message) { EzyByteBuffer buffer = newByteBuffer(message); writeHeader(buffer, message); writeSize(buffer, message); writeContent(buffer, message); byte[] answer = new byte[buffer.position()]; buffer.flip(); buffer.get(answer); return(answer); }
protected void updateBufferPosition(EzyByteBuffer buffer, int offset) { buffer.position(buffer.position() + offset); }