LinkedBuffer buffer = LinkedBuffer.allocate(BUF_SIZE);
try {
for (int i = 0; i < params.length; ++i) {
Schema<Object> schema = (Schema<Object>) RuntimeSchema.getSchema(params[i].getClass());
ProtostuffIOUtil.writeDelimitedTo(out, params[i], schema, buffer);
buffer.clear();
}
} catch (Exception e) {
throw new SeriException("Error occured when serialize using protostuff.", e);
}
return out.toByteArray();