int read = 0;
while (read < buffer.getBufferSize()) {
final long position = page * _volume.getStructure().getPageSize() + bb.position();
final int bytesRead = _channel.read(bb, position);
if (bytesRead <= 0) {
throw new PersistitIOException("Unable to read bytes at position " + position + " in " + this);
}
read += bytesRead;
}
_persistit.getIOMeter().chargeReadPageFromVolume(this._volume, buffer.getPageAddress(),
buffer.getBufferSize(), buffer.getIndex());
_volume.getStatistics().bumpReadCounter();
} catch (final IOException ioe) {
_persistit.getAlertMonitor().post(
new Event(AlertLevel.ERROR, _persistit.getLogBase().readException, ioe, _volume, page,
buffer.getIndex()), AlertMonitor.READ_PAGE_CATEGORY);
throw new PersistitIOException(ioe);
}
} finally {
release();
}
}