Class BaggageCodec
java.lang.Object
io.opentelemetry.api.baggage.propagation.BaggageCodec
Note: This class is based on code from Apache Commons Codec. It is comprised of code from these
classes:
Implements baggage-octet decoding in accordance with th Baggage header content specification. All US-ASCII characters excluding CTLs, whitespace, DQUOTE, comma, semicolon and backslash are encoded in `www-form-urlencoded` encoding scheme.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byteprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]decode(byte[] bytes) Decodes an array of URL safe 7-bit characters into an array of original bytes.(package private) static StringDecodes an array of URL safe 7-bit characters into an array of original bytes.private static intdigit16(byte b) Returns the numeric value of the characterbin radix 16.
-
Field Details
-
ESCAPE_CHAR
private static final byte ESCAPE_CHAR- See Also:
-
RADIX
private static final int RADIX- See Also:
-
-
Constructor Details
-
BaggageCodec
private BaggageCodec()
-
-
Method Details
-
decode
private static byte[] decode(byte[] bytes) Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted back to their original representation.- Parameters:
bytes- array of URL safe characters- Returns:
- array of original bytes
-
decode
Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted back to their original representation.- Parameters:
value- string of URL safe characterscharset- encoding of given string- Returns:
- decoded value
-
digit16
private static int digit16(byte b) Returns the numeric value of the characterbin radix 16.- Parameters:
b- The byte to be converted.- Returns:
- The numeric value represented by the character in radix 16.
-