void write(FlumeEventQueue queue) throws IOException {
LOG.info("Writing checkoint to " + file + ", size = " + queue.size());
RandomAccessFile dataOutput = new RandomAccessFile(file, "rw");
try {
// write out a small number
dataOutput.writeLong(Long.MIN_VALUE);
// write a the queue itself
dataOutput.writeInt(queue.getCapacity());
queue.write(dataOutput);
// force all changes to disk
dataOutput.getChannel().force(true);