Package com.lucimber.dbus.codec.decoder
Class ArrayDecoder<ValueT extends DBusType>
java.lang.Object
com.lucimber.dbus.codec.decoder.ArrayDecoder<ValueT>
- Type Parameters:
ValueT
- The data type of the array.
- All Implemented Interfaces:
Decoder<ByteBuffer,
DBusArray<ValueT>>
public final class ArrayDecoder<ValueT extends DBusType>
extends Object
implements Decoder<ByteBuffer,DBusArray<ValueT>>
A decoder which unmarshals an array from the byte stream format used by D-Bus.
-
Constructor Summary
ConstructorsConstructorDescriptionArrayDecoder
(DBusSignature signature) Creates a new instance with mandatory parameters. -
Method Summary
Modifier and TypeMethodDescriptiondecode
(ByteBuffer buffer, int offset) Decodes a specific type from a buffer.
-
Constructor Details
-
ArrayDecoder
Creates a new instance with mandatory parameters.- Parameters:
signature
- the signature describing the array
-
-
Method Details
-
decode
public DecoderResult<DBusArray<ValueT>> decode(ByteBuffer buffer, int offset) throws DecoderException Description copied from interface:Decoder
Decodes a specific type from a buffer.- Specified by:
decode
in interfaceDecoder<ByteBuffer,
DBusArray<ValueT extends DBusType>> - Parameters:
buffer
- The buffer that contains the marshalled type.offset
- The number of bytes of a message, that have already been decoded.- Returns:
- The result of the decoding procedure.
- Throws:
DecoderException
- If the value could not be decoded successfully.
-