* @return the byte array
*/
@SuppressWarnings("unchecked")
public static final byte[] seriMulti(Object[] params) {
ByteArrayOutputStream out = new ByteArrayOutputStream(BUF_SIZE * 2);
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();