Class TagContextBinarySerializer
java.lang.Object
io.opencensus.tags.propagation.TagContextBinarySerializer
- Direct Known Subclasses:
NoopTags.NoopTagContextBinarySerializer, TagContextBinarySerializerImpl
Object for serializing and deserializing
TagContexts with the binary format.
See opencensus-specs for the specification of the cross-language binary serialization format.
- Since:
- 0.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TagContextfromByteArray(byte[] bytes) Creates aTagContextfrom the given on-the-wire encoded representation.abstract byte[]toByteArray(TagContext tags) Serializes theTagContextinto the on-the-wire representation.
-
Constructor Details
-
TagContextBinarySerializer
public TagContextBinarySerializer()
-
-
Method Details
-
toByteArray
Serializes theTagContextinto the on-the-wire representation.This method should be the inverse of
fromByteArray(byte[]).Tags that have aTagMetadatawithTagMetadata.TagTtl.NO_PROPAGATIONwill not be serialized.- 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.- Since:
- 0.8
-
fromByteArray
Creates aTagContextfrom the given on-the-wire encoded representation.This method should be the inverse of
toByteArray(TagContext).- 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.- Since:
- 0.8
-