Top Description Fields Constructors Methods
io.opentelemetry.api.baggage.propagation

pack-priv Class BaggageCodec

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, java.nio.charset.Charset, .StandardCharsets

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

Modifier and TypeField and Description
private static final byte
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static byte[]

Returns:

array of original bytes
decode
(byte[]
array of URL safe characters
bytes
)

Decodes an array of URL safe 7-bit characters into an array of original bytes.

pack-priv static String

Returns:

decoded value
decode
(String
string of URL safe characters
value
,
Charset
encoding of given string
charset
)

Decodes an array of URL safe 7-bit characters into an array of original bytes.

private static int

Returns:

The numeric value represented by the character in radix 16.
digit16
(byte
The byte to be converted.
b
)

Returns the numeric value of the character b in radix 16.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ESCAPE_CHARback to summary
private static final byte ESCAPE_CHAR
RADIXback to summary
private static final int RADIX

Constructor Detail

BaggageCodecback to summary
private BaggageCodec()

Method Detail

decodeback to summary
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:byte[]

array of URL safe characters

Returns:byte[]

array of original bytes

decodeback to summary
pack-priv static String decode(String value, 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

string of URL safe characters

charset:Charset

encoding of given string

Returns:String

decoded value

digit16back to summary
private static int digit16(byte b)

Returns the numeric value of the character b in radix 16.

Parameters
b:byte

The byte to be converted.

Returns:int

The numeric value represented by the character in radix 16.