The buffer's mainly purpose is for performance with caching. Here is created everytime.
The following is a good sample. ` // Re-use (manage) this buffer to avoid allocating on every serialization LinkedBuffer buffer = LinkedBuffer.allocate(512); // ser final byte[] protostuff; try { protostuff = ProtostuffIOUtil.toByteArray(foo, schema, buffer); } finally { buffer.clear(); } ` [ Full content available at: https://github.com/apache/incubator-dubbo/pull/2618 ] This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
--------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org