Code example for FileChannel

Methods: tryLock

0
            return channel.lock(position, size, shared);
        } 
 
        @Override 
        public FileLock tryLock(long position, long size, boolean shared) throws IOException {
            return channel.tryLock(position, size, shared);
        } 
 
        @Override 
        protected void implCloseChannel() throws IOException { 
            channel.close();
        } 
         
        private long bytesLeft() throws IOException { 
            return limit - position();
        } 
    } 
     
 
}