Code example for FileLock

Methods: size

0
	/** 
	 * @tests java.nio.channels.FileLock#size() 
	 */ 
	public void test_size() { 
		FileLock fileLock1 = new MockFileLock(readWriteChannel, 20, 100, true);
		assertEquals(100, fileLock1.size());
 
		final long position = 0x0FFFFFFFFFFFFFFFL;
		final long size = ((long) Integer.MAX_VALUE + 1);
		FileLock fileLock2 = new MockFileLock(readWriteChannel, position, size,
				true); 
		assertEquals(size, fileLock2.size());
	} 
 
	/** 
	 * @tests java.nio.channels.FileLock#isShared() 
	 */ 
	public void test_isShared() { 
		assertFalse(mockLock.isShared());
		FileLock lock = new MockFileLock(null, 0, 10, true);
Contextual code suggestions in your IDE  Get Codota for Java