readableBytes property

int readableBytes

Amount of bytes which are readable from the current readerIndex (inclusive).


Bytes are considered readable if the index of the position, in this case the readerIndex, is smaller than the current writer index and is not discardable, i.E. smaller than the current readerIndex.

Implementation

int get readableBytes => writerIndex - readerIndex;