Interface Encoder

    • Method Detail

      • encodeBoolean

        void encodeBoolean​(boolean bool)
                    throws Exception
        Encodes a boolean.
        Parameters:
        bool - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeByte

        void encodeByte​(byte b)
                 throws Exception
        Encodes a byte.
        Parameters:
        b - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeSignedShort

        void encodeSignedShort​(short s)
                        throws Exception
        Encodes a signed short integer. The encoding format depends on the implementation.
        Parameters:
        s - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeUnsignedShort

        void encodeUnsignedShort​(short s)
                          throws Exception
        Encodes an unsigned short integer. The encoding format depends on the implementation.
        Parameters:
        s - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encode16

        void encode16​(short s)
               throws Exception
        Encodes a signed short integer. The encoding format is the 2's complement representation encoded in 2 bytes.
        Parameters:
        s - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeSignedInt

        void encodeSignedInt​(int i)
                      throws Exception
        Encodes a signed integer. The encoding format depends on the implementation.
        Parameters:
        i - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeUnsignedInt

        void encodeUnsignedInt​(int i)
                        throws Exception
        Encodes an unsigned integer. The encoding format depends on the implementation.
        Parameters:
        i - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encode32

        void encode32​(int i)
               throws Exception
        Encodes a signed integer. The encoding format is the 2's complement representation encoded in 4 bytes.
        Parameters:
        i - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeSignedLong

        void encodeSignedLong​(long l)
                       throws Exception
        Encodes a signed long integer. The encoding format depends on the implementation.
        Parameters:
        l - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeUnsignedLong

        void encodeUnsignedLong​(long l)
                         throws Exception
        Encodes an unsigned long integer. The encoding format depends on the implementation.
        Parameters:
        l - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encode64

        void encode64​(long l)
               throws Exception
        Encodes a signed long integer. The encoding format is the 2's complement representation encoded in 8 bytes.
        Parameters:
        l - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeNullableString

        void encodeNullableString​(String str)
                           throws Exception
        Encodes a string that can be null. Be careful, since Joram 5.19, by default String are encoded using UTF-8.
        Parameters:
        str - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeString

        void encodeString​(String str)
                   throws Exception
        Encodes a string that cannot be null. Be careful, since Joram 5.19, by default String are encoded using UTF-8.
        Parameters:
        str - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeNullableByteArray

        void encodeNullableByteArray​(byte[] b)
                              throws Exception
        Encodes a byte array that can be null.
        Parameters:
        b - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeByteArray

        void encodeByteArray​(byte[] b)
                      throws Exception
        Encodes a byte array that cannot be null.
        Parameters:
        b - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeNullableByteArray

        void encodeNullableByteArray​(byte[] b,
                                     int offset,
                                     int length)
                              throws Exception
        Encodes a byte array that can be null.
        Parameters:
        b - the value to encode
        offset - the starting index in array b
        length - the number of bytes to be encoded
        Throws:
        Exception - if an error occurs during encoding
      • encodeByteArray

        void encodeByteArray​(byte[] b,
                             int offset,
                             int length)
                      throws Exception
        Encodes a byte array that cannot be null.
        Parameters:
        b - the value to encode
        offset - the starting index in array b
        length - the number of bytes to be encoded
        Throws:
        Exception - if an error occurs during encoding
      • encodeFloat

        void encodeFloat​(float f)
                  throws Exception
        Encodes a float.
        Parameters:
        f - the value to encode
        Throws:
        Exception - if an error occurs during encoding
      • encodeDouble

        void encodeDouble​(double d)
                   throws Exception
        Encodes a double.
        Parameters:
        d - the value to encode
        Throws:
        Exception - if an error occurs during encoding