code: public long transferTo(OutputStream os)
              throws IOException
      {
          if (os == null) {
              throw new IllegalArgumentException("os is null");
          }
  
          if (closed) {
              throw new ClosedChannelException();
          }
  
          long totTransfered = 0;
  
          while (ensureBuffer()) {
              final int available = available();
              os.write(buffer, position, available);
              position += available;
              totTransfered += available;
          }
  
          return totTransfered;
      }
docs: Transfers the entire content of this {@link InputStream} to <i>os</i>.
  This potentially limits the amount of buffering required to decompress
  content.
  <p>
  Unlike {@link #read(byte[], int, int)}, 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 os The destination to write decompressed content to.
  @return The number of bytes transferred.
  @throws IOException
  @since 1.1.1