Class BaggageCodec
- java.lang.Object
-
- io.opentelemetry.api.baggage.propagation.BaggageCodec
-
class BaggageCodec extends java.lang.ObjectNote: 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
Fields Modifier and Type Field Description private static byteESCAPE_CHARprivate static intRADIX
-
Constructor Summary
Constructors Modifier Constructor Description privateBaggageCodec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static byte[]decode(byte[] bytes)Decodes an array of URL safe 7-bit characters into an array of original bytes.(package private) static java.lang.Stringdecode(java.lang.String value, java.nio.charset.Charset charset)Decodes 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 Detail
-
ESCAPE_CHAR
private static final byte ESCAPE_CHAR
- See Also:
- Constant Field Values
-
RADIX
private static final int RADIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
static java.lang.String decode(java.lang.String value, java.nio.charset.Charset charset)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.
-
-