Package com.lucimber.dbus.codec.encoder
Class ArrayEncoder<E extends DBusType>
java.lang.Object
com.lucimber.dbus.codec.encoder.ArrayEncoder<E>
- Type Parameters:
E
- The element's data type.
- All Implemented Interfaces:
Encoder<DBusArray<E>,
ByteBuffer>
public final class ArrayEncoder<E extends DBusType>
extends Object
implements Encoder<DBusArray<E>,ByteBuffer>
An encoder which encodes an array to the D-Bus marshalling format using ByteBuffer.
-
Constructor Summary
ConstructorsConstructorDescriptionArrayEncoder
(ByteOrder order, DBusSignature signature) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionEncodes a value into bytes.
-
Constructor Details
-
ArrayEncoder
Constructs a new instance.- Parameters:
order
- the byte order of the produced bytessignature
- the array signature (must be an array)
-
-
Method Details
-
encode
Description copied from interface:Encoder
Encodes a value into bytes.- Specified by:
encode
in interfaceEncoder<DBusArray<E extends DBusType>,
ByteBuffer> - Parameters:
array
- The data type that needs to be encoded.offset
- The byte count of already encoded bytes, which is necessary for alignment padding.- Returns:
- An
EncoderResult
containing the marshalled representation of the value. - Throws:
EncoderException
- If the value could not have been encoded.
-