def read_all
      content = String.new
      while bytes = read and !bytes.empty?
        content << bytes
      end
      content
    end
def read_all
      content = String.new
      while bytes = read and !bytes.empty?
        content << bytes
      end
      content
    end
reads the stream contents into a String object