- position
- the starting position.
- size
- the size of file to lock.
- shared
- true if the lock is shared.
Documentation for this section has not yet been entered.
Type Reason Java.Lang.IllegalArgumentException if any parameters are invalid. Java.Nio.Channels.ClosedChannelException if the file channel is closed. Java.Nio.Channels.OverlappingFileLockException if a lock is already held that overlaps this lock request or another thread is waiting to acquire a lock that will overlap with this request. Java.IO.IOException if any I/O error occurs.
Attempts to acquire an exclusive lock on this file without blocking. The method returns null if the acquisition would result in an overlapped lock with another OS process.
It is possible to acquire a lock for any region even if it's completely outside of the file's size. The size of the lock is fixed. If the file grows outside of the lock that region of the file won't be locked by this lock.