Code example for FileLock

Methods: release

0
      fileChannel_ = raFile_.getChannel();
//      lock_ = fileChannel_.lock(); 
   } 
    
   private void close() throws IOException { 
      lock_.release();
      lock_ = null;    
      fileChannel_.close();
      raFile_.close();
      fileChannel_ = null;
      raFile_ = null;
   } 
    
   private MappedByteBuffer makeReadOnlyBuffer(long byteOffset, long numBytes) throws IOException {
       return makeBuffer(FileChannel.MapMode.READ_ONLY, byteOffset, numBytes);
   } 
    
   private MappedByteBuffer makeBuffer(FileChannel.MapMode mode, long byteOffset, long numBytes) throws IOException {
      MappedByteBuffer buffer = fileChannel_.map(mode, byteOffset, numBytes);
      buffer.order(bigEndian_ ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN);
      return buffer;