ByteProcessor, but for external iteration rather than internal iteration.
The external iteration allows the callers to control the pace of the iteration.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of bytes left in the iterator.Get the current number of bytes left in the iterator. |
| public int | Returns: The current iterator offset into the underlying sequence of bytes.The current position of this iterator into the underlying sequence of bytes. |
| public byte | Returns: The next byte that was read by the most recent successful call toreadByte().Return the last byte that was read by |
| public default int | Returns: The number of bytes processed, if theprocess method returned
false, or -1 if the whole iterator was processed.The processor to use for processing the bytes in the iterator. processor)Process the remaining bytes in this iterator with the given |
| public boolean | Returns: true if the cursor read a byte and moved forward, otherwise false.Check if the iterator has at least one byte left, and if so, read that byte and move the cursor forward. |
| bytesLeft | back to summary |
|---|---|
| public int bytesLeft() Get the current number of bytes left in the iterator.
| |
| currentOffset | back to summary |
|---|---|
| public int currentOffset() The current position of this iterator into the underlying sequence of bytes. For instance, if we are iterating a buffer, this would be the iterators current offset into the buffer.
| |
| getByte | back to summary |
|---|---|
| public byte getByte() Return the last byte that was read by
| |
| process | back to summary |
|---|---|
| public default int process(ByteProcessor processor) Process the remaining bytes in this iterator with the given
| |
| readByte | back to summary |
|---|---|
| public boolean readByte() Check if the iterator has at least one byte left, and if so, read that byte and move the cursor forward.
The byte will then be available through the
| |