* @throws IOException If an error (including EOF) occurred while reading the stream.
*/
final void readFully(final int dataSize, int offset, int length) throws IOException {
ensureBufferContains(Math.min(length * dataSize, buffer.capacity()));
final Buffer view = createView(); // Must be after ensureBufferContains
int n = Math.min(view.remaining(), length);
transfer(offset, n);
skipInBuffer(n * dataSize);
while ((length -= n) != 0) {
offset += n;
ensureBufferContains(dataSize);