On Fri, Aug 19, 2011 at 3:51 PM, Steve Ulrich <[email protected]> wrote: >> Alan D. Cabrera [mailto:[email protected]] wrote: >> >> So, what is the scenario that we're trying to support? I imagine >> appending headers to binary data would be one. In this case is an >> Array of ByteBuffers really needed? Why not just send down one >> ByteBuffer for the header and another for the body that was sent to >> you? > > When sending a Header, a Body and a Footer this means going 3 times through > the (remaining) chain and in the end it may result in 3 TCP packages if > tcpNoDelay is activated (The splitting may be a client design problem, so > MINA could ignore it). > > As Julien mentioned, the CumulativeProtocolDecoder needs it to create an > automatic expanding Buffer. > >> Searching for use cases where we need this complexity. :) > > This wouldn't be a problem, if SUN had designed ByteBuffer to be extendable, > but with the package-private constructors you don't have a chance to write a > Wrapper or something similar. > > regards Steve
Look like we all finish with the same hacks around ByteBufffers ;) : http://svn.apache.org/repos/asf/incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java
