Code example for WritableByteChannel

Methods: write

0
    @Override 
    public int write(ByteBuffer buf) {
        checkClosed(); 
        checkWritable(); 
        try { 
            return writeChannel.write(buf);
        } catch (IOException ioe) {
            throw Py.IOError(ioe);
        } 
    } 
 
    @Override 
    public void flush() { 
        if (outputStream == null) {
            return; 
        } 
        try { 
            outputStream.flush();
        } catch (IOException ioe) {
            throw Py.IOError(ioe);
        }