// 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);