}
// only save page that has some data
if (data != null)
{
// allocate window for page
PageWindow window = getManager().createPageWindow(pageId, data.length);
// take the filechannel from the pool
FileChannel channel = diskDataStore.fileChannelPool.getFileChannel(getFileName(),
true);
try
{
// write the content
channel.write(ByteBuffer.wrap(data), window.getFilePartOffset());
}
catch (IOException e)
{
log.error("Error writing to a channel " + channel, e);
}