Code example for ReadableByteChannel

Methods: read

0
    @Override 
    public int readinto(ByteBuffer buf) {
        checkClosed(); 
        checkReadable(); 
        try { 
            return readChannel.read(buf);
        } catch (IOException ioe) {
            throw Py.IOError(ioe);
        } 
    } 
 
    @Override 
    public int write(ByteBuffer buf) {
        checkClosed(); 
        checkWritable(); 
        try { 
            return writeChannel.write(buf);
        } catch (IOException ioe) {
            throw Py.IOError(ioe);
        } 
    }