Code example for NonWritableChannelException

0
            throw new NullPointerException();
        } 
        if (position < 0) {
            throw new IllegalArgumentException();
        } 
        throw new NonWritableChannelException();
    } 
 
    public final int write(ByteBuffer buffer) throws IOException {
        openCheck(); 
        throw new NonWritableChannelException();
    } 
 
    public final long write(ByteBuffer[] buffers, int offset, int length)
            throws IOException { 
        if (offset < 0 || length < 0 || (offset + length) > buffers.length) {
            throw new IndexOutOfBoundsException();
        } 
        openCheck(); 
        throw new NonWritableChannelException();
    }