src/main/java/net/batchik/crdt/fiber/FiberChannels.java
/**
     * Write all remaining bytes in buffer to the given channel.
     *
     * @throws IllegalBlockingModeException
     *          If the channel is selectable and configured non-blocking.
     */
Write all remaining bytes in buffer to the given channel.
@throws IllegalBlockingModeException
If the channel is selectable and configured non-blocking.
Write all remaining bytes in buffer to the given channel . @throws IllegalBlockingModeException If the channel is selectable and configured non - blocking .
private static void writeFully(WritableByteChannel ch, ByteBuffer bb)
            throws IOException, InterruptedException, ExecutionException, SuspendExecution {
        try {
            lock.lock();
            if (ch instanceof SelectableChannel) {
                SelectableChannel sc = (SelectableChannel) ch;
                if (!sc.isBlocking()) {
                    throw new IllegalBlockingModeException();
                }
                writeFullyImpl(ch, bb);
            } else {
                writeFullyImpl(ch, bb);
            }
        } finally {
            lock.unlock();
        }
    }
private static void writeFully ( WritableByteChannel ch , ByteBuffer bb ) throws IOException , InterruptedException , ExecutionException , SuspendExecution { try { lock . lock ( ) ; if ( ch instanceof SelectableChannel ) { SelectableChannel sc = ( SelectableChannel ) ch ; if ( ! sc . isBlocking ( ) ) { throw new IllegalBlockingModeException ( ) ; } writeFullyImpl ( ch , bb ) ; } else { writeFullyImpl ( ch , bb ) ; } } finally { lock . unlock ( ) ; } }
Write all remaining bytes in buffer to the given channel.
Write all remaining bytes in buffer to the given channel .