code: public void writeToStream(OutputStream os, int len)
      throws IOException
    {
      while (len > 0) {
        if (_readLength <= _readOffset) {
          if (! readBuffer())
            return;
        }
  
        int sublen = Math.min(len, _readLength - _readOffset);
  
        os.write(_readBuffer, _readOffset, sublen);
        _readOffset += sublen;
        len -= sublen;
      }
    }
docs: Writes <code>len<code> bytes to the output stream from this stream.
  
  @param os destination stream.
  @param len bytes to write.