Interface Encoder

  • All Known Implementing Classes:
    ProtonEncoder

    public interface Encoder
    Encode AMQP types into binary streams
    • Method Detail

      • newEncoderState

        EncoderState newEncoderState()
        Creates a new EncoderState instance that can be used when interacting with the Encoder. For encoding that occurs on more than one thread while sharing a single Encoder instance a different state object per thread is required as the EncoderState object can retain some state information during the encode process that could be corrupted if more than one thread were to share a single instance. For single threaded encoding work the Encoder offers a utility cached EncoderState API that will return the same instance on each call which can reduce allocation overhead and make using the Encoder simpler.
        Returns:
        a newly constructed EncoderState instance.
      • getCachedEncoderState

        EncoderState getCachedEncoderState()
        Return a singleton EncoderState instance that is meant to be shared within single threaded encoder interactions. If more than one thread makes use of this cache EncoderState the results of any encoding done using this state object is not guaranteed to be correct. The returned instance will have its reset method called to ensure that any previously stored state data is cleared before the next use.
        Returns:
        a cached EncoderState linked to this Encoder instance.
      • writeNull

        void writeNull​(ProtonBuffer buffer,
                       EncoderState state)
                throws EncodeException
        Write a Null type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeBoolean

        void writeBoolean​(ProtonBuffer buffer,
                          EncoderState state,
                          boolean value)
                   throws EncodeException
        Write a Boolean type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeBoolean

        void writeBoolean​(ProtonBuffer buffer,
                          EncoderState state,
                          java.lang.Boolean value)
                   throws EncodeException
        Write a Boolean type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedByte

        void writeUnsignedByte​(ProtonBuffer buffer,
                               EncoderState state,
                               UnsignedByte value)
                        throws EncodeException
        Write an UnsignedByte type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedByte

        void writeUnsignedByte​(ProtonBuffer buffer,
                               EncoderState state,
                               byte value)
                        throws EncodeException
        Write an UnsignedByte type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedShort

        void writeUnsignedShort​(ProtonBuffer buffer,
                                EncoderState state,
                                UnsignedShort value)
                         throws EncodeException
        Write a UnsignedShort type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedShort

        void writeUnsignedShort​(ProtonBuffer buffer,
                                EncoderState state,
                                short value)
                         throws EncodeException
        Write a UnsignedShort type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedShort

        void writeUnsignedShort​(ProtonBuffer buffer,
                                EncoderState state,
                                int value)
                         throws EncodeException
        Write a UnsignedShort type encoding to the given buffer using the provided value with appropriate range checks to ensure invalid input is not accepted.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedInteger

        void writeUnsignedInteger​(ProtonBuffer buffer,
                                  EncoderState state,
                                  byte value)
                           throws EncodeException
        Write a UnsignedInteger type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedInteger

        void writeUnsignedInteger​(ProtonBuffer buffer,
                                  EncoderState state,
                                  int value)
                           throws EncodeException
        Write a UnsignedInteger type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedInteger

        void writeUnsignedInteger​(ProtonBuffer buffer,
                                  EncoderState state,
                                  long value)
                           throws EncodeException
        Write a UnsignedInteger type encoding to the given buffer using the provided value with appropriate range checks to ensure invalid input is not accepted.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedLong

        void writeUnsignedLong​(ProtonBuffer buffer,
                               EncoderState state,
                               UnsignedLong value)
                        throws EncodeException
        Write a UnsignedLong type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedLong

        void writeUnsignedLong​(ProtonBuffer buffer,
                               EncoderState state,
                               byte value)
                        throws EncodeException
        Write a UnsignedLong type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUnsignedLong

        void writeUnsignedLong​(ProtonBuffer buffer,
                               EncoderState state,
                               long value)
                        throws EncodeException
        Write a UnsignedLong type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeByte

        void writeByte​(ProtonBuffer buffer,
                       EncoderState state,
                       byte value)
                throws EncodeException
        Write a Byte type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeByte

        void writeByte​(ProtonBuffer buffer,
                       EncoderState state,
                       java.lang.Byte value)
                throws EncodeException
        Write a Byte type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeShort

        void writeShort​(ProtonBuffer buffer,
                        EncoderState state,
                        short value)
                 throws EncodeException
        Write a Short type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeShort

        void writeShort​(ProtonBuffer buffer,
                        EncoderState state,
                        java.lang.Short value)
                 throws EncodeException
        Write a Short type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeInteger

        void writeInteger​(ProtonBuffer buffer,
                          EncoderState state,
                          int value)
                   throws EncodeException
        Write a Integer type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeInteger

        void writeInteger​(ProtonBuffer buffer,
                          EncoderState state,
                          java.lang.Integer value)
                   throws EncodeException
        Write a Integer type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeLong

        void writeLong​(ProtonBuffer buffer,
                       EncoderState state,
                       long value)
                throws EncodeException
        Write a Long type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeLong

        void writeLong​(ProtonBuffer buffer,
                       EncoderState state,
                       java.lang.Long value)
                throws EncodeException
        Write a Long type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeFloat

        void writeFloat​(ProtonBuffer buffer,
                        EncoderState state,
                        float value)
                 throws EncodeException
        Write a Float type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeFloat

        void writeFloat​(ProtonBuffer buffer,
                        EncoderState state,
                        java.lang.Float value)
                 throws EncodeException
        Write a Float type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDouble

        void writeDouble​(ProtonBuffer buffer,
                         EncoderState state,
                         double value)
                  throws EncodeException
        Write a Double type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDouble

        void writeDouble​(ProtonBuffer buffer,
                         EncoderState state,
                         java.lang.Double value)
                  throws EncodeException
        Write a Double type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDecimal32

        void writeDecimal32​(ProtonBuffer buffer,
                            EncoderState state,
                            Decimal32 value)
                     throws EncodeException
        Write a Decimal32 type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDecimal64

        void writeDecimal64​(ProtonBuffer buffer,
                            EncoderState state,
                            Decimal64 value)
                     throws EncodeException
        Write a Decimal64 type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDecimal128

        void writeDecimal128​(ProtonBuffer buffer,
                             EncoderState state,
                             Decimal128 value)
                      throws EncodeException
        Write a Decimal128 type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeCharacter

        void writeCharacter​(ProtonBuffer buffer,
                            EncoderState state,
                            char value)
                     throws EncodeException
        Write a Character type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeCharacter

        void writeCharacter​(ProtonBuffer buffer,
                            EncoderState state,
                            java.lang.Character value)
                     throws EncodeException
        Write a Character type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeTimestamp

        void writeTimestamp​(ProtonBuffer buffer,
                            EncoderState state,
                            long value)
                     throws EncodeException
        Write a Time stamp type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeTimestamp

        void writeTimestamp​(ProtonBuffer buffer,
                            EncoderState state,
                            java.util.Date value)
                     throws EncodeException
        Write a Time stamp type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeUUID

        void writeUUID​(ProtonBuffer buffer,
                       EncoderState state,
                       java.util.UUID value)
                throws EncodeException
        Write a UUID type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeBinary

        void writeBinary​(ProtonBuffer buffer,
                         EncoderState state,
                         Binary value)
                  throws EncodeException
        Writes the contents of the given Binary value into the provided ProtonBuffer instance as an AMQP Binary type.

        If the provided value to write is null an AMQP null type is encoded into the target buffer.

        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeBinary

        void writeBinary​(ProtonBuffer buffer,
                         EncoderState state,
                         ProtonBuffer value)
                  throws EncodeException
        Writes the contents of the given ProtonBuffer value into the provided ProtonBuffer instance as an AMQP Binary type. This method does not modify the read index of the value given such that is can be read later or written again without needing to reset the read index manually.

        If the provided value to write is null an AMQP null type is encoded into the target buffer.

        Parameters:
        buffer - the target buffer where the binary value is to be encoded
        state - the EncoderState instance that manages the calling threads state tracking.
        value - the ProtonBuffer value to be encoded as an AMQP binary instance.
        Throws:
        EncodeException - if an error occurs while performing the encode
      • writeBinary

        void writeBinary​(ProtonBuffer buffer,
                         EncoderState state,
                         byte[] value)
                  throws EncodeException
        Writes the contents of the given byte value into the provided ProtonBuffer instance as an AMQP Binary type.

        If the provided value to write is null an AMQP null type is encoded into the target buffer.

        Parameters:
        buffer - the target buffer where the binary value is to be encoded
        state - the EncoderState instance that manages the calling threads state tracking.
        value - the ProtonBuffer value to be encoded as an AMQP binary instance.
        Throws:
        EncodeException - if an error occurs while performing the encode
      • writeString

        void writeString​(ProtonBuffer buffer,
                         EncoderState state,
                         java.lang.String value)
                  throws EncodeException
        Write a String type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeSymbol

        void writeSymbol​(ProtonBuffer buffer,
                         EncoderState state,
                         Symbol value)
                  throws EncodeException
        Write a Symbol type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeSymbol

        void writeSymbol​(ProtonBuffer buffer,
                         EncoderState state,
                         java.lang.String value)
                  throws EncodeException
        Write a Symbol type encoding to the given buffer. The provided String instance should contain only ASCII characters and the encoder should throw an EncodeException if a non-ASCII character is encountered.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeList

        <T> void writeList​(ProtonBuffer buffer,
                           EncoderState state,
                           java.util.List<T> value)
                    throws EncodeException
        Write a List type encoding to the given buffer.
        Type Parameters:
        T - The type that comprises the List entries.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeMap

        <K,​V> void writeMap​(ProtonBuffer buffer,
                                  EncoderState state,
                                  java.util.Map<K,​V> value)
                           throws EncodeException
        Write a Map type encoding to the given buffer.
        Type Parameters:
        K - the type that comprises the Map keys.
        V - the type that comprises the Map values.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeDeliveryTag

        void writeDeliveryTag​(ProtonBuffer buffer,
                              EncoderState state,
                              DeliveryTag value)
                       throws EncodeException
        Writes the contents of the given DeliveryTag value into the provided ProtonBuffer instance as an AMQP Binary type.

        If the provided value to write is null an AMQP null type is encoded into the target buffer.

        Parameters:
        buffer - the target buffer where the binary value is to be encoded
        state - the EncoderState instance that manages the calling threads state tracking.
        value - the DeliveryTag value to be encoded as an AMQP binary instance.
        Throws:
        EncodeException - if an error occurs while performing the encode
      • writeDescribedType

        void writeDescribedType​(ProtonBuffer buffer,
                                EncoderState state,
                                DescribedType value)
                         throws EncodeException
        Write a DescribedType type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeObject

        void writeObject​(ProtonBuffer buffer,
                         EncoderState state,
                         java.lang.Object value)
                  throws EncodeException
        Write the proper type encoding for the provided Object to the given buffer if an TypeEncoder can be found for it in the collection of registered type encoders..
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        boolean[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        byte[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        short[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        int[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        long[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        float[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        double[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        char[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        java.lang.Object[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        Decimal32[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        Decimal64[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        Decimal128[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        Symbol[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        UnsignedByte[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        UnsignedShort[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        UnsignedInteger[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        UnsignedLong[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • writeArray

        void writeArray​(ProtonBuffer buffer,
                        EncoderState state,
                        java.util.UUID[] value)
                 throws EncodeException
        Write the given array as with the proper array type encoding to the given buffer.
        Parameters:
        buffer - The buffer where the write operation is targeted
        state - The EncoderState to use for any intermediate encoding work.
        value - The value to be encoded into the provided buffer.
        Throws:
        EncodeException - if an error occurs during the encode operation.
      • registerDescribedTypeEncoder

        <V> Encoder registerDescribedTypeEncoder​(DescribedTypeEncoder<V> encoder)
                                          throws EncodeException
        Register a DescribedTypeEncoder which can be used when writing custom types using this encoder. When an Object write is performed the type encoder registry will be consulted in order to find the best match for the given Object instance.
        Type Parameters:
        V - The type that the encoder handles.
        Parameters:
        encoder - A new DescribedTypeEncoder that will be used when encoding its matching type.
        Returns:
        this Encoder instance.
        Throws:
        EncodeException - if an error occurs while adding the encoder to the registry.
      • getTypeEncoder

        TypeEncoder<?> getTypeEncoder​(java.lang.Object value)
        Lookup a TypeEncoder that would be used to encode the given Object.
        Parameters:
        value - The value which should be used to resolve the TypeEncoder that encodes it.
        Returns:
        the matching TypeEncoder for the given value or null if no match found.
      • getTypeEncoder

        TypeEncoder<?> getTypeEncoder​(java.lang.Class<?> typeClass)
        Lookup a TypeEncoder that would be used to encode the given Class.
        Parameters:
        typeClass - The Class which should be used to resolve the TypeEncoder that encodes it.
        Returns:
        the matching TypeEncoder for the given value or null if no match found.