Interface Decoder

  • All Known Implementing Classes:
    ByteBufferDecoder

    public interface Decoder
    Interface of a decoder
    • Method Detail

      • decodeSignedShort

        short decodeSignedShort()
                         throws Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes a byte.
        Returns:
        the decoded value
        Throws:
        Exception - if an error occurs during decoding
      • decodeNullableByteArray

        byte[] decodeNullableByteArray()
                                throws Exception
        Decodes a byte array that can be null.
        Returns:
        the decoded value
        Throws:
        Exception - if an error occurs during decoding
      • decodeByteArray

        byte[] decodeByteArray()
                        throws Exception
        Decodes 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 Exception
        Decodes 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 Exception
        Decodes a boolean.
        Returns:
        the decoded value
        Throws:
        Exception - if an error occurs during decoding
      • decodeFloat

        float decodeFloat()
                   throws Exception
        Decodes a float.
        Returns:
        the decoded value
        Throws:
        Exception - if an error occurs during decoding
      • decodeDouble

        double decodeDouble()
                     throws Exception
        Decodes a double.
        Returns:
        the decoded value
        Throws:
        Exception - if an error occurs during decoding