outBuffer.reset();
outBuffer.writeUTF(payload.getApp());
outBuffer.writeInt(payload.getNumMessages());
outBuffer.writeByte(payload.getCompression());
outBuffer.writeLong(payload.getCrc());
outBuffer.writeInt(payload.getMessages().length);
outBuffer.write(payload.getMessages());
return ByteBuffer.wrap(outBuffer.getData(), 0, outBuffer.getLength()).array();
} catch (Exception e) {