Class JaxbMessageWriter<T extends MessageBase>
java.lang.Object
com.sportradar.livedata.sdk.proto.common.JaxbMessageWriter<T>
- All Implemented Interfaces:
MessageWriter<T>
A
MessageWriter implementation which uses JAXB to marshal the messages- Author:
- uros.bregar
-
Constructor Summary
ConstructorsConstructorDescriptionJaxbMessageWriter(JaxbBuilder builder) Initializes a new instance of theJaxbMessageWriterclass. -
Method Summary
Modifier and TypeMethodDescriptionGets the configured character encoding for the writer.byte[]Writes the passedmessageto the returnedbyte[]
-
Constructor Details
-
JaxbMessageWriter
Initializes a new instance of theJaxbMessageWriterclass.- Parameters:
builder- the builder used to build requeiredMarshallerinstances.- Throws:
IllegalArgumentException- Thebuilderis a null reference
-
-
Method Details
-
write
Writes the passedmessageto the returnedbyte[]- Specified by:
writein interfaceMessageWriter<T extends MessageBase>- Parameters:
message- The message to be written to the array.- Returns:
- The
byte[]containing message data. - Throws:
MessageException- Themessagecould not be written to specified mediaProtocolException- thrown when an un-expected situation is encountered.
-
getEncoding
Gets the configured character encoding for the writer.- Specified by:
getEncodingin interfaceMessageWriter<T extends MessageBase>- Returns:
- - a string, i.e. UTF-8
-