A buffer for reading bytes from an InputStream. At any time, the buffer is partitioned into three sections,
from left to right: consumed, pending and free.
Consumed bytes were read from the InputStream and also passed to the application. This data can be deleted.
Pending bytes were read from the InputStream and not passed to the application.
Free space at the end of the buffer is not occupied by useful bytes, new read from the InputStream go here.
A buffer for reading bytes from an InputStream. At any time, the buffer is partitioned into three sections, from left to right: consumed, pending and free. Consumed bytes were read from the InputStream and also passed to the application. This data can be deleted. Pending bytes were read from the InputStream and not passed to the application. Free space at the end of the buffer is not occupied by useful bytes, new read from the InputStream go here.