Class UnsignedIntegerTypeEncoder
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.encoders.AbstractPrimitiveTypeEncoder<UnsignedInteger>
-
- org.apache.qpid.protonj2.codec.encoders.primitives.UnsignedIntegerTypeEncoder
-
- All Implemented Interfaces:
PrimitiveTypeEncoder<UnsignedInteger>
,TypeEncoder<UnsignedInteger>
public final class UnsignedIntegerTypeEncoder extends AbstractPrimitiveTypeEncoder<UnsignedInteger>
Encoder of AMQP UnsignedShort type values to a byte stream.
-
-
Constructor Summary
Constructors Constructor Description UnsignedIntegerTypeEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<UnsignedInteger>
getTypeClass()
void
writeRawArray(ProtonBuffer buffer, EncoderState state, Object[] values)
Write an array elements of the AMQP type to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, byte value)
Write the full AMQP type data for the unsigned int to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, int value)
Write the full AMQP type data for the unsigned int to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, long value)
Write the full AMQP type data for the unsigned integer to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, UnsignedInteger value)
Write the full AMQP type data to the given byte buffer.-
Methods inherited from class org.apache.qpid.protonj2.codec.encoders.AbstractPrimitiveTypeEncoder
isArrayType, writeArray
-
-
-
-
Method Detail
-
getTypeClass
public Class<UnsignedInteger> getTypeClass()
- Returns:
- the Class type that this encoder handles.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, UnsignedInteger 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 tostate
- The current encoder statevalue
- The value that is to be written.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, byte value)
Write the full AMQP type data for the unsigned int 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
- TheProtonBuffer
instance to write the encoding to.state
- TheEncoderState
for use in encoding operations.value
- The unsigned integer single byte value to encode.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, int value)
Write the full AMQP type data for the unsigned int 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
- TheProtonBuffer
instance to write the encoding to.state
- TheEncoderState
for use in encoding operations.value
- The unsigned int value to encode.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, long value)
Write the full AMQP type data for the unsigned integer 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
- TheProtonBuffer
instance to write the encoding to.state
- TheEncoderState
for use in encoding operations.value
- The long value to encode as an unsigned integer.
-
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 tostate
- The current encoder statevalues
- The array of values that is to be written.
-
-