code: public String readHeader() throws IOException {
  		byte[] buffer = new byte[BUFFER_SIZE];
  		StringBuilder content = new StringBuilder(BUFFER_SIZE);
  		while (content.indexOf(HEADER_END) == -1) {
  			int amountRead = checkedRead(buffer, 0, BUFFER_SIZE);
  			content.append(new String(buffer, 0, amountRead));
  		}
  		return content.substring(0, content.indexOf(HEADER_END));
  	}
docs: Read the HTTP header from the {@link InputStream}. Note: This method doesn't expect
  any HTTP content after the header since the initial request is usually just a
  WebSocket upgrade.
  @return the HTTP header
  @throws IOException in case of I/O errors