public void writeToChannel(WritableByteChannel channel) throws IOException {
   channel.write(ByteBuffer.wrap(new byte[] {version}));
   channel.write(ByteBuffer.wrap(Ints.toByteArray(totalSize)));
   channel.write(ByteBuffer.wrap(Ints.toByteArray(sizePer)));
   channel.write(ByteBuffer.wrap(new byte[] {compression.getId()}));
   baseLongBuffers.writeToChannel(channel);
 }