The channel upon whose file this lock was acquired.
The channel upon whose file this lock was acquired. If the underlying NIO channel is a standard channel type, the appropriate ZIO-NIO wrapper class is returned, otherwise a generic zio.nio.channels.Channel is returned.
Tells whether this lock is shared.
Tells whether or not this lock is valid.
Tells whether or not this lock is valid. A lock object remains valid until it is released or the associated file channel is closed, whichever comes first.
Tells whether or not this lock overlaps the given lock range.
Tells whether or not this lock overlaps the given lock range.
The starting position of the lock range
The size of the lock range
Returns the position within the file of the first byte of the locked region.
Returns the position within the file of the first byte of the locked region. A locked region need not be contained within, or even overlap, the actual underlying file, so the value returned by this method may exceed the file's current size.
Returns the size of the locked region in bytes.
Returns the size of the locked region in bytes. A locked region need not be contained within, or even overlap, the actual underlying file, so the value returned by this method may exceed the file's current size.
A token representing a lock on a region of a file. A file-lock object is created each time a lock is acquired on a file via one of the
lock
ortryLock
methods of theFileChannel
class, or thelock
ortryLock
methods of theAsynchronousFileChannel
class.