Package fr.dyade.aaa.common.encoding
Interface Decoder
-
- All Known Implementing Classes:
ByteBufferDecoder
public interface DecoderInterface of a decoder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description shortdecode16()Decodes a signed short integer.intdecode32()Decodes a signed integer.longdecode64()Decodes a signed long integer.booleandecodeBoolean()Decodes a boolean.bytedecodeByte()Decodes a byte.byte[]decodeByteArray()Decodes a byte array that cannot be null.byte[]decodeByteArray(int length)Decodes a byte array that cannot be null.doubledecodeDouble()Decodes a double.floatdecodeFloat()Decodes a float.byte[]decodeNullableByteArray()Decodes a byte array that can be null.StringdecodeNullableString()Decodes a string that can be null.intdecodeSignedInt()Decodes a signed integer.longdecodeSignedLong()Decodes a signed long integer.shortdecodeSignedShort()Decodes a signed short integer.StringdecodeString()Decodes a string that cannot be null.StringdecodeString(int length)Decodes a string that cannot be null.intdecodeUnsignedInt()Decodes an unsigned integer.longdecodeUnsignedLong()Decodes an unsigned long integer.shortdecodeUnsignedShort()Decodes an unsigned short integer.
-
-
-
Method Detail
-
decodeSignedShort
short decodeSignedShort() throws ExceptionDecodes a signed short integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeUnsignedShort
short decodeUnsignedShort() throws ExceptionDecodes an unsigned short integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decode16
short decode16() throws ExceptionDecodes a signed short integer. The encoding format is the 2's complement representation encoded in 2 bytes.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeSignedInt
int decodeSignedInt() throws ExceptionDecodes a signed integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeUnsignedInt
int decodeUnsignedInt() throws ExceptionDecodes an unsigned integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decode32
int decode32() throws ExceptionDecodes a signed integer. The encoding format is the 2's complement representation encoded in 4 bytes.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeSignedLong
long decodeSignedLong() throws ExceptionDecodes a signed long integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeUnsignedLong
long decodeUnsignedLong() throws ExceptionDecodes an unsigned long integer. The encoding format depends on the implementation.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decode64
long decode64() throws ExceptionDecodes a signed long integer. The encoding format is the 2's complement representation encoded in 8 bytes.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeNullableString
String decodeNullableString() throws Exception
Decodes a string that can be null. Be careful, since Joram 5.19, by default String are encoded using UTF-8.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeString
String decodeString() throws Exception
Decodes a string that cannot be null. Be careful, since Joram 5.19, by default String are encoded using UTF-8.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeString
String decodeString(int length) throws Exception
Decodes a string that cannot be null. Be careful, since Joram 5.19, by default String are encoded using UTF-8.- Parameters:
length- the length of the string- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeByte
byte decodeByte() throws ExceptionDecodes a byte.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeNullableByteArray
byte[] decodeNullableByteArray() throws ExceptionDecodes a byte array that can be null.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeByteArray
byte[] decodeByteArray() throws ExceptionDecodes a byte array that cannot be null.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeByteArray
byte[] decodeByteArray(int length) throws ExceptionDecodes a byte array that cannot be null.- Parameters:
length- the length of the array- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeBoolean
boolean decodeBoolean() throws ExceptionDecodes a boolean.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
decodeFloat
float decodeFloat() throws ExceptionDecodes a float.- Returns:
- the decoded value
- Throws:
Exception- if an error occurs during decoding
-
-