public class AtomPrefixes
extends java.lang.Object
This class has the logic for creating and checking bag prefixes. It does not directly create or deal with bit
representations; that is contained in AtomPrefixTypes
.
The baggage protocol only uses the first byte of an atom as a prefix. Consequently, during parsing, instead of interpreting the first byte, we just look it up in an array of 256 prefix objects.
Modifier and Type | Class and Description |
---|---|
static class |
AtomPrefixes.AtomPrefix
The first byte of an atom is its prefix, which contains some metadata about the atom; the first bit of an atom
denotes whether it is a data atom or header atom.
|
static class |
AtomPrefixes.DataPrefix |
static class |
AtomPrefixes.HeaderPrefix
The first byte of a header atom also specifies whether it is indexed or keyed, and the header's level
|
static class |
AtomPrefixes.IndexedHeaderPrefix
The payload of an indexed header is expected to be an unsigned variable-length lexicographically consistent
integer:
UnsignedLexVarint |
static class |
AtomPrefixes.KeyedHeaderPrefix
The payload of a keyed header is expected to be arbitrary length bytes.
|
static class |
AtomPrefixes.UnsupportedPrefix |
Modifier and Type | Method and Description |
---|---|
static AtomPrefixes.AtomPrefix |
get(byte prefix)
Get the
AtomPrefixes.AtomPrefix object for the specified prefix |
static void |
main(java.lang.String[] args) |
public static AtomPrefixes.AtomPrefix get(byte prefix)
AtomPrefixes.AtomPrefix
object for the specified prefixprefix
- the first byte of an atomAtomPrefixes.AtomPrefix
object that corresponds to this prefixpublic static void main(java.lang.String[] args)