Determine whether the underlying data has the specified number of bytes available starting at the current byte position.
Determine whether the underlying data has the specified number of bytes available starting at the current byte position. This function must block until either nBytes are known to be available or end-of-file is reached. This does not advance the current position.
the number of bytes to determine if are available
true if nBytes are available, false otherwise
Return the number of currently available bytes.
Return the number of currently available bytes.
This should not be used to determine the length of the data, as more bytes may become available in the future. This should really only be used for debug purposes.
Alerts the implementation to attempt to free data that is no longer used, if possible.
Alerts the implementation to attempt to free data that is no longer used, if possible. If possible, this should free any unlocked bytes.
Return a byte array with data from the current byte position.
Return a byte array with data from the current byte position.
Stores the next len bytes of data in dest starting at index off. In len bytes are not available or len bytes cannot fit in the dest array starting at the given offset, the dest array is not modified and false is returned.
true if len bytes are available and written to the dest array, false otherwise
Return a single byte at the current byte position with a value in the range of 0 to 255.
Return a single byte at the current byte position with a value in the range of 0 to 255.
Increments the current byte position if successful.
the byte at the current byte position if it exists, or -1 if EOF is reached.
Set the specified byte position as a location that that one may want to call setPosition in the future.
Set the specified byte position as a location that that one may want to call setPosition in the future. This is essentially setting a mark in the data that can be reset back to later. Implementations are allowed to free any bytes before a locked byte position. Any bytes after a locked position cannot be freed until that lock is release.
Note that this "lock" has nothing to do with synchronization, but behaves more like marks that must be accessable until released.
the byte position to lock
Set the current byte position, using zero-based indexing
Set the current byte position, using zero-based indexing
bytPos0b cannot be greater than the most recent read data. In other words, this can only be used to move backwards in data.
the new current byte position
Get the current byte position, using zero-based indexing
Get the current byte position, using zero-based indexing
the current byte position
Release a previously locked byte position, allowing the implementation to free any unlocked bytes.
Release a previously locked byte position, allowing the implementation to free any unlocked bytes.
the byte position to release
Wraps a java.nio.ByteBuffer in a InputSource
When an instance of this class is created, it creates a readOnly copy of the ByteBuffer. The current position of the ByteBuffer is considered index 0. For example, if thed passed in ByteBuffer had position 2, calling setPosition(0) would reset the byteBuffer back to position 2. The limit of the ByteBuffer is considered the end of data.