docs: private String checkHeaderCharacters(String data) { //PI45266
          // if the last character is a CR or LF, then this fails
          int index = data.length() - 1;
          if (index < 0) {
              // empty string, quit now with success
              return data;
          }
          String error = null;
          char c = data.charAt(index);
          if (BNFHeaders.LF == c || BNFHeaders.CR == c) {
              error = "Illegal trailing EOL";
          }
  
          // scan through the data now for invalid CRLF presence. Note that CRLFs
          // may be followed by whitespace for valid multiline headers.
          StringBuilder sb = new StringBuilder(); //PI57228
          for (int i = 0; null == error && i <= index; i++) {
              c = data.charAt(i);
              if (i < index) {
                  if (BNFHeaders.CR == c) {
                      // next char must be an LF
                      if (BNFHeaders.LF != data.charAt(i + 1)) {
                          error = "Invalid CR not followed by LF";
                      }
                  } else if (BNFHeaders.LF == c) {
                      char x = data.charAt(i + 1);
                      // if it is not followed by whitespace then this value is bad
                      if (BNFHeaders.TAB != x && BNFHeaders.SPACE != x) {
                          error = "Invalid LF not followed by whitespace";
                      }
                  }
              }
              if (c >= 32 && c < 127) {
                  sb.append(c);
              } else if (c == BNFHeaders.LF || c == BNFHeaders.CR) {
                  sb.append(' ');
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Found a CR or LF, replacing it with SP");
                  }
              } else {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "The Character: " + c + " is not printable");
                  }
                  final int maskedCodePoint = c & 0xFF;
                  if (maskedCodePoint == BNFHeaders.LF || maskedCodePoint == BNFHeaders.CR) {
                      sb.append('?');
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "Character: " + c + " unicode ends with a 0a or 0d, replacing it with ?");
                          Tr.debug(tc, "The Unicode is: " + (char) maskedCodePoint);
                      }
                  } else
                      sb.append(c);
              }
          }
  
          // if we found an error, throw the exception now
          if (null != error) {
              IllegalArgumentException iae = new IllegalArgumentException(error);
              FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(String)", "1", this);
              throw iae;
          }
          return sb.toString();
      }