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