-
- Enclosing class:
- ByteToMessageDecoder
public static interface ByteToMessageDecoder.CumulatorCumulateBuffers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Buffercumulate(BufferAllocator alloc, Buffer cumulation, Buffer in)BufferdiscardSomeReadBytes(Buffer cumulation)Consume the given buffer and return a new buffer with the same readable data, but where any data before the read offset may have been removed.
-
-
-
Method Detail
-
cumulate
Buffer cumulate(BufferAllocator alloc, Buffer cumulation, Buffer in)
Cumulate the givenBuffers and return theBufferthat holds the cumulated bytes. The implementation is responsible to correctly handle the life-cycle of the givenBuffers and so callResource.close()if aBufferis fully consumed.
-
discardSomeReadBytes
Buffer discardSomeReadBytes(Buffer cumulation)
Consume the given buffer and return a new buffer with the same readable data, but where any data before the read offset may have been removed. The returned buffer may be the same buffer instance as the buffer passed in.- Parameters:
cumulation- The buffer we wish to trim already processed bytes from.- Returns:
- A buffer where the bytes before the reader-offset have been removed.
-
-