0

I'm using ChannelBuffers.dynamicBuffer() to manage fragmentation of unknown size messages over a network using Netty. My question is, when I readBytes(...) from the buffer, do the bytes that got read automatically get "trimmed" from the buffer so it doesn't grow to a ridiculous size over time? If not, how would I go about doing this myself?

Thanks.

1 Answers1

0

No it does not trim it self. It even not allow to trim later. The only way you can do this is to create a new one.

Norman Maurer
  • 23,104
  • 2
  • 33
  • 31
  • In Netty 4, all buffers are dynamic and you can shrink the capacity by calling `ByteBuf.capacity(int)` with the smaller capacity. – trustin Aug 29 '12 at 03:32