> Another issue to think about is how we can implement auto-expansion. > Many users find it very useful when they construct a variable length > message. My idea right now is to provide a builder class which builds > an Iterable<ByteBuffer> or ByteBuffer depending on user preference. > Same preference property should be provided by the protocol codec > framework for those who still wants a single ByteBuffer. I will also > explore this in the branch.
If Iterable<ByteBuffer> could be extended by specifying a buffer pool/factory in the builder class I think users should make use of that for expanding their message size. However we could delegate the expansion function to a factory if users want the convenience of writing to a single buffer. I don't think it should be automatic anymore. Here are some ideas regarding a ByteBuffer pool/factory interface and requirements and how we could use a factory to possibly achieve auto-expand functionality. http://pastebin.com/f3934290d -karl
