Class BaggageCodec
- java.lang.Object
-
- io.opentelemetry.api.baggage.propagation.BaggageCodec
-
class BaggageCodec extends java.lang.Object
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
Fields Modifier and Type Field Description private static byte
ESCAPE_CHAR
private static int
RADIX
-
Constructor Summary
Constructors Modifier Constructor Description private
BaggageCodec()
-
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.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.private static int
digit16(byte b)
Returns the numeric value of the characterb
in 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 characterb
in radix 16.- Parameters:
b
- The byte to be converted.- Returns:
- The numeric value represented by the character in radix 16.
-
-