code: public long transferTo(WritableByteChannel wbc)
              throws IOException
      {
          if (wbc == null) {
              throw new IllegalArgumentException("wbc is null");
          }
  
          if (closed) {
              throw new ClosedChannelException();
          }
  
          final ByteBuffer bb = ByteBuffer.wrap(buffer);
  
          long totTransfered = 0;
  
          while (ensureBuffer()) {
              bb.clear();
              bb.position(position);
              bb.limit(position + available());
  
              wbc.write(bb);
  
              final int written = bb.position() - position;
              position += written;
  
              totTransfered += written;
          }
  
          return totTransfered;
      }
docs: Transfers the entire content of this {@link ReadableByteChannel} to
  <i>wbc</i>. This potentially limits the amount of buffering required to
  decompress content.
  <p/>
  <p>
  Unlike {@link #read(ByteBuffer)}, this method does not need to be called
  multiple times. A single call will transfer all available content. Any
  calls after the source has been exhausted will result in a return value
  of {@code 0}.
  </p>
  
  @param wbc The destination to write decompressed content to.
  @return The number of bytes transferred.
  @throws IOException
  @since 1.1.1