Package com.lucimber.dbus.codec.encoder
Class Int16Encoder
java.lang.Object
com.lucimber.dbus.codec.encoder.Int16Encoder
- All Implemented Interfaces:
Encoder<DBusInt16,ByteBuffer>
An encoder which encodes a short to the D-Bus marshalling format using ByteBuffer.
-
Constructor Summary
ConstructorsConstructorDescriptionInt16Encoder(ByteOrder order) Constructs a new instance with mandatory parameter. -
Method Summary
Modifier and TypeMethodDescriptionEncodes a value into bytes.
-
Constructor Details
-
Int16Encoder
Constructs a new instance with mandatory parameter.- Parameters:
order- The byte order for encoding.
-
-
Method Details
-
encode
Description copied from interface:EncoderEncodes a value into bytes.- Specified by:
encodein interfaceEncoder<DBusInt16,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.
-