@ Nonnegative public static long channelCopy ( @ Nonnull @ WillNotClose final ReadableByteChannel aSrc , @ Nonnull @ WillNotClose final WritableByteChannel aDest ) throws IOException { ValueEnforcer . notNull ( aSrc , "SourceChannel" ) ; ValueEnforcer . isTrue ( aSrc . isOpen ( ) , "SourceChannel is not open!" ) ; ValueEnforcer . notNull ( aDest , "DestinationChannel" ) ; ValueEnforcer . isTrue ( aDest . isOpen ( ) , "DestinationChannel is not open!" ) ; long nBytesWritten ; if ( USE_COPY_V1 ) nBytesWritten = _channelCopy1 ( aSrc , aDest ) ; else nBytesWritten = _channelCopy2 ( aSrc , aDest ) ; return nBytesWritten ; }
Copy all content from the source channel to the destination channel .