Class BinaryTypeEncoder
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.encoders.AbstractPrimitiveTypeEncoder<Binary>
-
- org.apache.qpid.protonj2.codec.encoders.primitives.BinaryTypeEncoder
-
- All Implemented Interfaces:
PrimitiveTypeEncoder<Binary>,TypeEncoder<Binary>
public final class BinaryTypeEncoder extends AbstractPrimitiveTypeEncoder<Binary>
Encoder of AMQP Binary type values to a byte stream.
-
-
Constructor Summary
Constructors Constructor Description BinaryTypeEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<Binary>getTypeClass()voidwriteRawArray(ProtonBuffer buffer, EncoderState state, Object[] values)Write an array elements of the AMQP type to the given byte buffer.voidwriteType(ProtonBuffer buffer, EncoderState state, byte[] value)Shortcut API that allows abyte[]to be directly encoded as an AMQP Binary type without the need to create aBinaryinstance.voidwriteType(ProtonBuffer buffer, EncoderState state, ProtonBuffer value)Shortcut API that allows aProtonBufferto be directly encoded as an AMQP Binary type without the need to create aBinaryinstance.voidwriteType(ProtonBuffer buffer, EncoderState state, Binary 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
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, Binary value)
Description copied from interface:TypeEncoderWrite 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, ProtonBuffer value)
Shortcut API that allows aProtonBufferto be directly encoded as an AMQP Binary type without the need to create aBinaryinstance. The encoder will attempt to write the smallest encoding possible based on the buffer size.- Parameters:
buffer- TheProtonBufferinstance to write the encoding to.state- TheEncoderStatefor use in encoding operations.value- TheProtonBufferinstance that is to be encoded.
-
writeType
public void writeType(ProtonBuffer buffer, EncoderState state, byte[] value)
Shortcut API that allows abyte[]to be directly encoded as an AMQP Binary type without the need to create aBinaryinstance. The encoder will attempt to write the smallest encoding possible based on the buffer size.- Parameters:
buffer- TheProtonBufferinstance to write the encoding to.state- TheEncoderStatefor use in encoding operations.value- Thebyte[]instance that is to be encoded.
-
writeRawArray
public void writeRawArray(ProtonBuffer buffer, EncoderState state, Object[] values)
Description copied from interface:TypeEncoderWrite 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.
-
-