SdkBufferedSource
A source that keeps a buffer internally such that small reads are performant. It also allows peeking ahead, buffering data as necessary, before consuming it.
Inheritors
Properties
Functions
Returns true if there are no more bytes in this source. This will block until there are bytes to read or the source is definitely exhausted.
Get an input stream that reads from this source
Returns a new SdkBufferedSource that can read data from this source without consuming it. The returned source becomes invalid once this source is next read or closed.
Returns a new SdkBufferedSource that can read data from this source without consuming it. The returned source becomes invalid once this source is next read or closed.
Reads all bytes from this and appends them to sink. Returns the total number of bytes written which will be 0 if this source is exhausted.
Read four bytes from this source and returns a little-endian long.
Read eight bytes in little-endian order from this source and returns them as a long.
Read two bytes from this source and returns it as a little-endian short.
Read two bytes in little-endian order from this source and returns them as a short.
Reads all bytes from this source, decodes them as UTF-8, and returns the string.
Reads byteCount bytes from this source, decodes them as UTF-8, and returns the string.
Returns true when the buffer contains at least byteCount bytes. False if the source is exhausted before the requested number of bytes could be read
Returns when the buffer contains at least byteCount bytes or throws EOFException if the source is exhausted before the requested number of bytes could be read
Returns when the buffer contains at least byteCount bytes or throws EOFException if the source is exhausted before the requested number of bytes could be read
Discards byteCount bytes from this source. Throws IOException if source is exhausted before byteCount bytes can be discarded.
Discards byteCount bytes from this source. Throws IOException if source is exhausted before byteCount bytes can be discarded.