code: int getEncodedLength(CharSequence data) {
          if (data instanceof AsciiString) {
              AsciiString string = (AsciiString) data;
              try {
                  encodedLengthProcessor.reset();
                  string.forEachByte(encodedLengthProcessor);
                  return encodedLengthProcessor.length();
              } catch (Exception e) {
                  PlatformDependent.throwException(e);
                  return -1;
              }
          } else {
              return getEncodedLengthSlowPath(data);
          }
      }
docs: Returns the number of bytes required to Huffman encode the input string literal.
  
  @param data the string literal to be Huffman encoded
  @return the number of bytes required to Huffman encode {@code data}