Code example for ClosedChannelException

0
                    end(readCount > 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);
    }