-
- Enclosing class:
- ByteToMessageDecoder
public static interface ByteToMessageDecoder.Cumulator
CumulateBuffer
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Buffer
cumulate(BufferAllocator alloc, Buffer cumulation, Buffer in)
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.
-
-
-
Method Detail
-
cumulate
Buffer cumulate(BufferAllocator alloc, Buffer cumulation, Buffer in)
Cumulate the givenBuffer
s and return theBuffer
that holds the cumulated bytes. The implementation is responsible to correctly handle the life-cycle of the givenBuffer
s and so callResource.close()
if aBuffer
is 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.
-
-