readAtMost
Reads at most len bytes from the data source starting at the given pos into the buf array, starting at offset off.
This function attempts to read up to len bytes into the buffer. Fewer bytes may be read only if the end of the data is reached. This method never blocks indefinitely.
Return
The number of bytes actually read, or 0 if the end of data is reached
Parameters
The starting position in the data source (must be ≥ 0; values beyond data size are treated as EOF)
The destination byte array
The starting offset in the buffer (must be in [0, buf.size))
The maximum number of bytes to read (must be in 0, buf.size - off)
Throws
If an I/O error occurs (for file/network-backed implementations)
Reads at most buf.size bytes from the data source starting at pos into the given buf.
Equivalent to: readAtMost(pos, buf, 0, buf.size)
Throws
If an I/O error occurs