private byte[] getAlgorithmNameBinary() {
    if (algorithmNameBinary != null) {
      return algorithmNameBinary;
    }

    synchronized (this) {
      if (algorithmNameBinary == null) {
        String algorithmName = getAlgorithmName();
        if (algorithmName == null || algorithmName.length() == 0) {
          throw new IllegalArgumentException("algorithmName cannot be null or empty.");
        }

        // Convert name to binary.
        byte[] binary = algorithmName.getBytes(StandardCharsets.UTF_8);
        if (binary.length > MAX_ALGORITHM_NAME_LENGTH) {
          throw new IllegalArgumentException(
              "algorithmName " + algorithmName + " exceeds the size of " + MAX_ALGORITHM_NAME_LENGTH + " bytes.");
        }
        algorithmNameBinary = binary;
      }
    }

    return algorithmNameBinary;
  }
Get the algorithm name in binary format.
This binary will be saved into the compressed buffer.  The algorithm name will be used to find the decompressor.
The byte array contains the algorithm name.
The binary generation happens only once per algorithm (cached) and is thread safe.

@return Binary presentation of algorithm name.  Its length cannot exceed MAX_ALGORITHM_NAME_LENGTH bytes.
ambry-commons/src/main/java/com/github/ambry/compression/BaseCompression.java