docs: private int findHeaderEndTag(int index) {
          int currentIdx = index;
          int depth = 0;
          while (currentIdx < buffer.length()) {
              byte currentByte = buffer.get(currentIdx);
              if (currentByte == (byte) '<') {
                  boolean isEndTag = (currentIdx + 1) < buffer.length() && buffer.get(currentIdx+1) == '/';
                  if (isEndTag && depth > 0) {
                      // Found an end tag corresponding to some header element within soap:Header
                      depth--;
                      currentIdx = findFrom('>', currentIdx + 1);
                      if (currentIdx == -1) {
                          return -1;
                      }
                  } else if (isEndTag && depth == 0) {
                      // Found it!  Probably.
                      int end = findFrom('>', currentIdx + 1);
                      return end;
                  } else {
                      // Found a start tag corresponding to a child element of soap:Header
                      depth++;
                      currentIdx = findFrom('>', currentIdx + 1);
                      if (currentIdx == -1) {
                          return -1;
                      }
                  }
              } else {
                  currentIdx++;
              }
          }
          return -1;
      }