result.put(header.required ? (byte) 0x01 : (byte) 0x00);
ByteBuffer tmp = ByteBuffer.allocate(1024);
tmp.setAutoExpand(true);
Output tmpOut = new Output(tmp);
Serializer tmpSer = new Serializer();
tmpSer.serialize(tmpOut, header.data);
tmp.flip();
// Size of header data
result.putInt(tmp.limit());
// Header data
result.put(tmp);
tmp.release();
tmp = null;
}
// One body
result.putShort((short) 1);
// Method name
Output.putString(result, method);
// Client callback for response
Output.putString(result, "");
// Serialize parameters
ByteBuffer tmp = ByteBuffer.allocate(1024);
tmp.setAutoExpand(true);
Output tmpOut = new Output(tmp);
tmpOut.writeArray(params, new Serializer());
tmp.flip();
// Store size and parameters
result.putInt(tmp.limit());
result.put(tmp);