Class Marshaler
java.lang.Object
io.opentelemetry.exporter.internal.marshal.Marshaler
- Direct Known Subclasses:
LowAllocationLogsRequestMarshaler, LowAllocationMetricsRequestMarshaler, LowAllocationTraceRequestMarshaler, MarshalerWithSize
Marshaler from an SDK structure to protobuf wire format.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intReturns the number of bytes this Marshaler will write in proto binary format.final voidwriteBinaryTo(OutputStream output) Marshals into theOutputStreamin proto binary format.final voidwriteJsonTo(com.fasterxml.jackson.core.JsonGenerator output) Marshals into theJsonGeneratorin proto JSON format.final voidwriteJsonTo(OutputStream output) Marshals into theOutputStreamin proto JSON format.final voidwriteJsonWithNewline(com.fasterxml.jackson.core.JsonGenerator output) Marshals into theJsonGeneratorin proto JSON format and adds a newline.protected abstract voidwriteTo(Serializer output)
-
Constructor Details
-
Marshaler
public Marshaler()
-
-
Method Details
-
writeBinaryTo
Marshals into theOutputStreamin proto binary format.- Throws:
IOException
-
writeJsonTo
Marshals into theOutputStreamin proto JSON format.- Throws:
IOException
-
writeJsonTo
Marshals into theJsonGeneratorin proto JSON format.- Throws:
IOException
-
writeJsonWithNewline
public final void writeJsonWithNewline(com.fasterxml.jackson.core.JsonGenerator output) throws IOException Marshals into theJsonGeneratorin proto JSON format and adds a newline.- Throws:
IOException
-
getBinarySerializedSize
public abstract int getBinarySerializedSize()Returns the number of bytes this Marshaler will write in proto binary format. -
writeTo
- Throws:
IOException
-