code: public static String readLine(InputStream inputStream, String charset) throws IOException {
          LOG.trace("enter LaxHttpParser.readLine(InputStream, String)");
          byte[] rawdata = readRawLine(inputStream);
          if (rawdata == null) {
              return null;
          }
          // strip CR and LF from the end
          int len = rawdata.length;
          int offset = 0;
          if (len > 0) {
              if (rawdata[len - 1] == '\n') {
                  offset++;
                  if (len > 1) {
                      if (rawdata[len - 2] == '\r') {
                          offset++;
                      }
                  }
              }
          }
          return EncodingUtil.getString(rawdata, 0, len - offset, charset);
      }
docs: Read up to <tt>"\n"</tt> from an (unchunked) input stream.
  If the stream ends before the line terminator is found,
  the last part of the string will still be returned.
  If no input data available, <code>null</code> is returned.
  
  @param inputStream the stream to read from
  @param charset charset of HTTP protocol elements
  
  @throws IOException if an I/O problem occurs
  @return a line from the stream
  
  @since 3.0