/** * Writes a readable channel to a writable channel. * * @param readableChannel The readable channel. * @param writableChannel The writable channel. * @throws IOException */ public static void copy(ReadableByteChannel readableChannel, WritableByteChannel writableChannel) throws IOException { if ((readableChannel != null) && (writableChannel != null)) { BioUtils.copy( new NbChannelInputStream(readableChannel), new NbChannelOutputStream(writableChannel)); } }
/** * Writes a NIO readable channel to a BIO output stream. * * @param readableChannel The readable channel. * @param outputStream The output stream. * @throws IOException */ public static void copy(ReadableByteChannel readableChannel, OutputStream outputStream) throws IOException { if ((readableChannel != null) && (outputStream != null)) { BioUtils.copy(new NbChannelInputStream(readableChannel), outputStream); } }