Package com.lucimber.dbus.codec.encoder
Class VariantEncoder
java.lang.Object
com.lucimber.dbus.codec.encoder.VariantEncoder
- All Implemented Interfaces:
Encoder<DBusVariant,ByteBuffer>
An encoder which encodes a variant to the D-Bus marshalling format using ByteBuffer.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVariantEncoder(ByteOrder order) Constructs a new instance with mandatory parameter. -
Method Summary
Modifier and TypeMethodDescriptionencode(DBusVariant variant, int offset) Encodes a value into bytes.
-
Constructor Details
-
VariantEncoder
Constructs a new instance with mandatory parameter.- Parameters:
order- the byte order of the produced bytes.
-
-
Method Details
-
encode
Description copied from interface:EncoderEncodes a value into bytes.- Specified by:
encodein interfaceEncoder<DBusVariant,ByteBuffer> - Parameters:
variant- The data type that needs to be encoded.offset- The byte count of already encoded bytes, which is necessary for alignment padding.- Returns:
- An
EncoderResultcontaining the marshalled representation of the value. - Throws:
EncoderException- If the value could not have been encoded.
-