code: private String readHeader() throws IOException {
          StringBuffer buffer = new StringBuffer();
          int aChar;
          do {
              aChar = m_inStream.read();
              if (aChar == -1) {
                  // Unexpected EOF
                  throw new IOException("Unexpected EOF");
              }
  
              // here, got a character; append it to the line
              buffer.append((char)aChar);
          } while (aChar != '\n');
          
          // Buffer could be empty.
          return buffer.toString();
      }
docs: since we are reading header lines and expect no UTF-8/Unicode issues.