60616263646566
public final FileChannel truncate(long size) throws IOException { openCheck(); if (size < 0) { throw new IllegalArgumentException(); } throw new NonWritableChannelException(); }
69707172737475
long count) throws IOException { openCheck(); if (!src.isOpen()) { throw new ClosedChannelException(); } throw new NonWritableChannelException(); }
828384858687888990
} if (position < 0 || size < 0 || size > Integer.MAX_VALUE) { throw new IllegalArgumentException(); } if (mode != MapMode.READ_ONLY) { throw new NonWritableChannelException(); } return super.mapImpl(IMemorySystem.MMAP_READ_ONLY, position, size); }
9596979899100101102103
} protected final FileLock basicLock(long position, long size, boolean shared, boolean wait) throws IOException { if (!shared) { throw new NonWritableChannelException(); } return super.basicLock(position, size, shared, true); }
430431432433434435436437438439440
openCheck(); if (!target.isOpen()) { throw new ClosedChannelException(); } if (target instanceof ReadOnlyFileChannel) { throw new NonWritableChannelException(); } if (position < 0 || count < 0) { throw new IllegalArgumentException(); }
28293031323334353637
/** * @tests {@link java.nio.channels.NonWritableChannelException#NonWritableChannelException()} */ public void test_Constructor() { NonWritableChannelException e = new NonWritableChannelException(); assertNull(e.getMessage()); assertNull(e.getLocalizedMessage()); assertNull(e.getCause()); }
39404142434445
/** * @tests serialization/deserialization compatibility. */ public void testSerializationSelf() throws Exception { SerializationTest.verifySelf(new NonWritableChannelException()); }
47484950515253
/** * @tests serialization/deserialization compatibility with RI. */ public void testSerializationCompatibility() throws Exception { SerializationTest.verifyGolden(this, new NonWritableChannelException()); }
431432433434435436437438439440441
openCheck(); if (!target.isOpen()) { throw new ClosedChannelException(); } if (target instanceof ReadOnlyFileChannel) { throw new NonWritableChannelException(); } if (position < 0 || count < 0 || position > Integer.MAX_VALUE || count > Integer.MAX_VALUE) { throw new IllegalArgumentException(); }
38394041424344
throw new NullPointerException(); } if (position < 0) { throw new IllegalArgumentException(); } throw new NonWritableChannelException(); }