code: public long transferFrom(ReadableByteChannel rbc)
              throws IOException
      {
          if (closed) {
              throw new ClosedChannelException();
          }
  
          if (rbc == null) {
              throw new NullPointerException();
          }
  
          if (buffer.remaining() == 0) {
              flushBuffer();
          }
  
          long totTransfered = 0;
          int read;
          while ((read = rbc.read(buffer)) != -1) {
              if (buffer.remaining() == 0) {
                  flushBuffer();
              }
  
              totTransfered += read;
          }
  
          return totTransfered;
      }
docs: Transfers all the content from <i>rbc</i> to this
  {@link WritableByteChannel}. This potentially limits the amount of
  buffering required to compress content.
  
  @param rbc The source of data to compress.
  @return The number of bytes read from <i>rbc</i>.
  @throws IOException
  @since 1.1.1