docs: public static int[] getHeaderToViewPosition(JTextArea view, String header, int start, int end) {
          validateView(view);
          validateHeader(header);
          validateStartEnd(start, end);
  
          if (!isValidStartEndForLength(start, end, header.length())) {
              return INVALID_POSITION;
          }
  
          int excessChars = 0;
  
          int pos = 0;
          while ((pos = header.indexOf(HttpHeader.CRLF, pos)) != -1 && pos < start) {
              pos += 2;
              ++excessChars;
          }
  
          int len = view.getDocument().getLength();
          int finalStartPos = start - excessChars;
          if (finalStartPos > len) {
              return INVALID_POSITION;
          }
  
          if (pos != -1) {
              while ((pos = header.indexOf(HttpHeader.CRLF, pos)) != -1 && pos < end) {
                  pos += 2;
                  ++excessChars;
              }
          }
  
          int finalEndPos = end - excessChars;
          if (finalEndPos > len) {
              return INVALID_POSITION;
          }
  
          return new int[] { finalStartPos, finalEndPos };
      }