code: public int available() throws IOException {
      	
      	// PK79219 start
      	long longLeft = limit - total;
      	if (longLeft>Integer.MAX_VALUE)
      		return ((count - pos) + in.available());
      	else
              return Math.min((count - pos) + in.available(), (int)longLeft);
      	// PK79219 end	
      }
docs: Returns the number of bytes that can be read without blocking.
  @return the number of available bytes
  @exception IOException if an I/O error has occurred