Class Base16EncodingUtils

java.lang.Object
io.opentelemetry.api.impl.Base16EncodingUtils

public final class Base16EncodingUtils extends Object
Base16 encoding and decoding utilities.

This class is not intended for use by application developers. Its API is stable and will not be changed or removed in a backwards-incompatible manner.

Since:
1.68.0
  • Method Details

    • longFromBase16String

      public static long longFromBase16String(CharSequence chars, int offset)
      Returns the long value whose base16 representation is stored in the first 16 chars of chars starting from the offset.
      Parameters:
      chars - the base16 representation of the long.
      offset - the starting offset in the CharSequence.
    • longToBase16String

      public static void longToBase16String(long value, char[] dest, int destOffset)
      Appends the base16 encoding of the specified value to the dest.
      Parameters:
      value - the value to be converted.
      dest - the destination char array.
      destOffset - the starting offset in the destination char array.
    • bytesFromBase16

      public static byte[] bytesFromBase16(CharSequence value, int length)
      Returns the byte[] decoded from the given hex CharSequence.
    • bytesFromBase16

      public static void bytesFromBase16(CharSequence value, int length, byte[] bytes)
      Fills bytes with bytes decoded from the given hex CharSequence.
    • isValidBase16String

      public static boolean isValidBase16String(CharSequence value)
      Returns whether the CharSequence is a valid hex string.