Package com.lucimber.dbus.codec.encoder
Class UInt16Encoder
java.lang.Object
com.lucimber.dbus.codec.encoder.UInt16Encoder
- All Implemented Interfaces:
Encoder<DBusUInt16,ByteBuffer>
An encoder which encodes an unsigned 16-bit integer to the D-Bus marshalling format using
ByteBuffer.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUInt16Encoder(ByteOrder order) Constructs a new instance with mandatory parameter. -
Method Summary
Modifier and TypeMethodDescriptionencode(DBusUInt16 value, int offset) Encodes a value into bytes.
-
Constructor Details
-
UInt16Encoder
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<DBusUInt16,ByteBuffer> - Parameters:
value- 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.
-