Class ArrayTypeEncoder
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.encoders.primitives.ArrayTypeEncoder
-
- All Implemented Interfaces:
PrimitiveTypeEncoder<java.lang.Object>
,TypeEncoder<java.lang.Object>
public final class ArrayTypeEncoder extends java.lang.Object implements PrimitiveTypeEncoder<java.lang.Object>
Encoder of AMQP Array types to a byte stream.
-
-
Constructor Summary
Constructors Constructor Description ArrayTypeEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<java.lang.Object>
getTypeClass()
boolean
isArrayType()
void
writeArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values)
Write an array elements of the AMQP type to the given byte buffer.void
writeRawArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values)
Write an array elements of the AMQP type to the given byte buffer.void
writeType(ProtonBuffer buffer, EncoderState state, boolean[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, byte[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, char[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, double[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, float[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, int[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, long[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, short[] value)
Encodes the given array into the provided buffer for transmission.void
writeType(ProtonBuffer buffer, EncoderState state, java.lang.Object value)
Write the full AMQP type data to the given byte buffer.
-
-
-
Method Detail
-
isArrayType
public boolean isArrayType()
- Specified by:
isArrayType
in interfaceTypeEncoder<java.lang.Object>
- Returns:
- true if the type handled by this encoded is an AMQP Array type.
-
getTypeClass
public java.lang.Class<java.lang.Object> getTypeClass()
- Specified by:
getTypeClass
in interfaceTypeEncoder<java.lang.Object>
- Returns:
- the Class type that this encoder handles.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, java.lang.Object 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.
- Specified by:
writeType
in interfaceTypeEncoder<java.lang.Object>
- Parameters:
buffer
- The buffer to write the AMQP type tostate
- The current encoder statevalue
- The value that is to be written.
-
writeArray
public void writeArray(ProtonBuffer buffer, EncoderState state, java.lang.Object[] values)
Description copied from interface:TypeEncoder
Write an array elements of the AMQP type to the given byte buffer.This method writes the full Array type definition of an array of the type this encoder manages.
- Specified by:
writeArray
in interfaceTypeEncoder<java.lang.Object>
- Parameters:
buffer
- The buffer to write the AMQP array elements tostate
- The current encoder statevalues
- The array of values that is to be written.
-
writeRawArray
public void writeRawArray(ProtonBuffer buffer, EncoderState state, java.lang.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.
- Specified by:
writeRawArray
in interfaceTypeEncoder<java.lang.Object>
- Parameters:
buffer
- The buffer to write the AMQP array elements tostate
- The current encoder statevalues
- The array of values that is to be written.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, boolean[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, byte[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, short[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, int[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, long[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, float[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, double[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, char[] value)
Encodes the given array into the provided buffer for transmission.- Parameters:
buffer
- TheProtonBuffer
where the array encoding should be written.state
- TheEncoderState
which can be used when encoding the array elements.value
- The array that should be encoded using thisArrayTypeEncoder
.
-
-