code: public void readFrom(InputStream in, byte[] buffer) throws IOException {
          String header;
          while ((header = HttpUtils.readLine(in, buffer, MAX_HEADER_LENGTH)) != null) {
              if (header.length() == 0) {
                  break;
              }
              processHeaderLine(header);
          }
      }
docs: Read and parse headers from the given InputStream until a blank line is
  reached. Except for Cookies, all other headers that contain multiple
  fields delimited by commas are parsed into multiple headers.
  
  @param in stream to read from
  @param buffer temporary buffer to use