Code example for NotYetConnectedException

0
        } 
    } 
 
    /** 
     * @see java.nio.channels.SocketChannel#write(java.nio.ByteBuffer) 
     */ 
    @Override 
    public int write(ByteBuffer source) throws IOException {
        if (null == source) {
            throw new NullPointerException();
        } 
        checkOpenConnected(); 
        if (!source.hasRemaining()) {
            return 0; 
        } 
        return writeImpl(source);
    } 
 
    /** 
     * @see java.nio.channels.SocketChannel#write(java.nio.ByteBuffer[], int, 
     *      int)