Abstract class for encoding and decoding values of type A to and from MessagePack format. Encapsulates logic to map MessagePack binary representations into native type structures and vice versa.
This class requires an implementation for two core operations: decoding a value of type A from a MessagePack representation and encoding a value of type A into a MessagePack representation.
Attributes
- Companion
- object
- Source
- MessagePackCodec.scala
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Attempts to decode a value of type A from the specified MessagePackReader, but may fail with MessagePackCodecError error if the MessagePack input does not encode a value of this type.
Attempts to decode a value of type A from the specified MessagePackReader, but may fail with MessagePackCodecError error if the MessagePack input does not encode a value of this type.
Value parameters
- in
-
an instance of
MessagePackReaderwhich provides access to the MessagePack input to parse a MessagePack value to value of typeA
Attributes
- Source
- MessagePackCodec.scala
Encodes the specified value using provided MessagePackWriter, but may fail with MessagePackCodecError if it cannot be encoded properly according to MessagePack specification requirements.
Encodes the specified value using provided MessagePackWriter, but may fail with MessagePackCodecError if it cannot be encoded properly according to MessagePack specification requirements.
Value parameters
- out
-
an instance of
MessagePackWriterwhich provides access to MessagePack output to serialize the specified value as a MessagePack value - x
-
the value provided for serialization
Attributes
- Source
- MessagePackCodec.scala
Concrete methods
Decodes a value of type A from the given ByteBuffer. If decoding fails, a SchemaError is returned.
Decodes a value of type A from the given ByteBuffer. If decoding fails, a SchemaError is returned.
Value parameters
- input
-
the
ByteBuffercontaining the binary data to be decoded
Attributes
- Returns
-
Eitherwhere theLeftcontains aSchemaErrorif decoding fails, or theRightcontains the successfully decoded value of typeA - Definition Classes
- Source
- MessagePackCodec.scala
Decodes a value of type A from the given byte array. If decoding fails, a SchemaError is returned.
Decodes a value of type A from the given byte array. If decoding fails, a SchemaError is returned.
Value parameters
- input
-
the byte array containing the binary data to be decoded
Attributes
- Returns
-
Eitherwhere theLeftcontains aSchemaErrorif decoding fails, or theRightcontains the successfully decoded value of typeA - Source
- MessagePackCodec.scala
Encodes the specified value of type A into binary format and writes it to the provided ByteBuffer.
Encodes the specified value of type A into binary format and writes it to the provided ByteBuffer.
Value parameters
- output
-
the
ByteBufferwhere the encoded binary data is written - value
-
the value of type
Ato be serialized into binary format
Attributes
- Definition Classes
- Source
- MessagePackCodec.scala
Encodes the specified value of type A into a binary format.
Encodes the specified value of type A into a binary format.
Value parameters
- value
-
the value of type
Ato be serialized into binary format
Attributes
- Returns
-
an array of bytes representing the binary-encoded data
- Source
- MessagePackCodec.scala
Attributes
- Source
- MessagePackCodec.scala
Attributes
- Source
- MessagePackCodec.scala