code: public int getAvailable()
      throws IOException
    {
      if (_isPartDone)
        return 0;
      else if (_peekOffset < _peekLength)
        return _peekLength - _peekOffset;
      else {
        int ch = read();
        if (ch < 0)
          return 0;
        _peekOffset = 0;
        _peekLength = 1;
        _peek[0] = (byte) ch;
  
        return 1;
      }
    }
docs: Returns the number of available bytes.