Package java.nio.channels

Examples of java.nio.channels.NonWritableChannelException


  public final FileChannel truncate(long size) throws IOException {
    openCheck();
        if (size < 0) {
            throw new IllegalArgumentException();
        }
    throw new NonWritableChannelException();
  }
View Full Code Here


            long count) throws IOException {
        openCheck();
        if (!src.isOpen()) {
            throw new ClosedChannelException();
        }
        throw new NonWritableChannelException();
    }
View Full Code Here

    }
    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);
  }
View Full Code Here

  }

  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);
  }
View Full Code Here

        openCheck();
        if (!target.isOpen()) {
            throw new ClosedChannelException();
        }
        if (target instanceof ReadOnlyFileChannel) {
            throw new NonWritableChannelException();
        }
        if (position < 0 || count < 0) {
            throw new IllegalArgumentException();
        }
View Full Code Here

   
    /**
     * @tests {@link java.nio.channels.NonWritableChannelException#NonWritableChannelException()}
     */
    public void test_Constructor() {
        NonWritableChannelException e = new NonWritableChannelException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new NonWritableChannelException());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new NonWritableChannelException());
    }
View Full Code Here

        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();
        }
View Full Code Here

            throw new NullPointerException();
        }
        if (position < 0) {
            throw new IllegalArgumentException();
        }
        throw new NonWritableChannelException();
    }
View Full Code Here

TOP

Related Classes of java.nio.channels.NonWritableChannelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.