Class TagContextBinarySerializerImpl
java.lang.Object
io.opencensus.tags.propagation.TagContextBinarySerializer
io.opencensus.implcore.tags.propagation.TagContextBinarySerializerImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromByteArray(byte[] bytes) Creates aTagContextfrom the given on-the-wire encoded representation.byte[]toByteArray(TagContext tags) Serializes theTagContextinto the on-the-wire representation.
-
Field Details
-
EMPTY_BYTE_ARRAY
private static final byte[] EMPTY_BYTE_ARRAY -
state
-
-
Constructor Details
-
TagContextBinarySerializerImpl
TagContextBinarySerializerImpl(CurrentState state)
-
-
Method Details
-
toByteArray
Description copied from class:TagContextBinarySerializerSerializes theTagContextinto the on-the-wire representation.This method should be the inverse of
TagContextBinarySerializer.fromByteArray(byte[]).Tags that have aTagMetadatawithTagMetadata.TagTtl.NO_PROPAGATIONwill not be serialized.- Specified by:
toByteArrayin classTagContextBinarySerializer- Parameters:
tags- theTagContextto serialize.- Returns:
- the on-the-wire representation of a
TagContext. - Throws:
TagContextSerializationException- if the result would be larger than the maximum allowed serialized size.
-
fromByteArray
Description copied from class:TagContextBinarySerializerCreates aTagContextfrom the given on-the-wire encoded representation.This method should be the inverse of
TagContextBinarySerializer.toByteArray(TagContext).- Specified by:
fromByteArrayin classTagContextBinarySerializer- Parameters:
bytes- on-the-wire representation of aTagContext.- Returns:
- a
TagContextdeserialized frombytes. - Throws:
TagContextDeserializationException- if there is a parse error, the input contains invalid tags, or the input is larger than the maximum allowed serialized size.
-