private void addNewFreeEntry ( FileEntry fe ) throws IOException { ByteBuffer buf = ByteBuffer . allocate ( KEY_POS ) ; buf . putInt ( fe . size ) ; buf . putInt ( 0 ) ; buf . putInt ( 0 ) ; buf . putInt ( 0 ) ; buf . putLong ( - 1 ) ; buf . flip ( ) ; channel . write ( buf , fe . offset ) ; freeList . add ( fe ) ; }
Writes a new free entry to the file and also adds it to the free list