Class UnsignedShortTypeEncoder

java.lang.Object
org.apache.qpid.protonj2.codec.encoders.AbstractPrimitiveTypeEncoder<UnsignedShort>
org.apache.qpid.protonj2.codec.encoders.primitives.UnsignedShortTypeEncoder
All Implemented Interfaces:
PrimitiveTypeEncoder<UnsignedShort>, TypeEncoder<UnsignedShort>

public final class UnsignedShortTypeEncoder extends AbstractPrimitiveTypeEncoder<UnsignedShort>
Encoder of AMQP UnsignedShort type values to a byte stream.
  • Constructor Details

    • UnsignedShortTypeEncoder

      public UnsignedShortTypeEncoder()
  • Method Details

    • getTypeClass

      public Class<UnsignedShort> getTypeClass()
      Returns:
      the Class type that this encoder handles.
    • writeType

      public void writeType(ProtonBuffer buffer, EncoderState state, UnsignedShort value)
      Description copied from interface: TypeEncoder
      Write the full AMQP type data to the given byte buffer.

      This can consist of writing both a type constructor value and the bytes that make up the value of the type being written.

      Parameters:
      buffer - The buffer to write the AMQP type to
      state - The current encoder state
      value - The value that is to be written.
    • writeType

      public void writeType(ProtonBuffer buffer, EncoderState state, short value)
      Write the full AMQP type data for the unsigned short to the given byte buffer. This can consist of writing both a type constructor value and the bytes that make up the value of the type being written.
      Parameters:
      buffer - The ProtonBuffer instance to write the encoding to.
      state - The EncoderState for use in encoding operations.
      value - The short value to encode as an unsigned short.
    • writeType

      public void writeType(ProtonBuffer buffer, EncoderState state, int value)
      Write the full AMQP type data for the unsigned short to the given byte buffer. This can consist of writing both a type constructor value and the bytes that make up the value of the type being written.
      Parameters:
      buffer - The ProtonBuffer instance to write the encoding to.
      state - The EncoderState for use in encoding operations.
      value - The int value to encode unsigned short.
    • writeRawArray

      public void writeRawArray(ProtonBuffer buffer, EncoderState state, Object[] values)
      Description copied from interface: TypeEncoder
      Write an array elements of the AMQP type to the given byte buffer.

      This method writes only the body portion of an AMQP array of this type, the array encoding, size and element count should be assumed to be managed by the caller.

      Parameters:
      buffer - The buffer to write the AMQP array elements to
      state - The current encoder state
      values - The array of values that is to be written.