Package com.lucimber.dbus.codec.encoder
Class SignatureEncoder
java.lang.Object
com.lucimber.dbus.codec.encoder.SignatureEncoder
- All Implemented Interfaces:
Encoder<DBusSignature,
ByteBuffer>
An encoder which encodes a signature to the D-Bus marshalling format using ByteBuffer.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencode
(DBusSignature signature, int offset) Encodes a value into bytes.
-
Constructor Details
-
SignatureEncoder
public SignatureEncoder()
-
-
Method Details
-
encode
public EncoderResult<ByteBuffer> encode(DBusSignature signature, int offset) throws EncoderException Description copied from interface:Encoder
Encodes a value into bytes.- Specified by:
encode
in interfaceEncoder<DBusSignature,
ByteBuffer> - Parameters:
signature
- 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.
-