Class Binary32TypeDecoder
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.decoders.AbstractPrimitiveTypeDecoder<Binary>
-
- org.apache.qpid.protonj2.codec.decoders.primitives.AbstractBinaryTypeDecoder
-
- org.apache.qpid.protonj2.codec.decoders.primitives.Binary32TypeDecoder
-
- All Implemented Interfaces:
BinaryTypeDecoder
,PrimitiveTypeDecoder<Binary>
,StreamTypeDecoder<Binary>
,TypeDecoder<Binary>
public final class Binary32TypeDecoder extends AbstractBinaryTypeDecoder
Decoder of AMQP Binary values from a byte stream.
-
-
Constructor Summary
Constructors Constructor Description Binary32TypeDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getTypeCode()
int
readSize(InputStream stream)
Reads the encoded size value for the encoded binary payload and returns it.int
readSize(ProtonBuffer buffer)
Reads the encoded size value for the encoded binary payload and returns it.-
Methods inherited from class org.apache.qpid.protonj2.codec.decoders.primitives.AbstractBinaryTypeDecoder
readValue, readValue, readValueAsArray, readValueAsArray, readValueAsBuffer, readValueAsBuffer, skipValue, skipValue
-
Methods inherited from class org.apache.qpid.protonj2.codec.decoders.AbstractPrimitiveTypeDecoder
isArrayType, isJavaPrimitive, readArrayElements, readArrayElements
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.protonj2.codec.decoders.primitives.BinaryTypeDecoder
getTypeClass
-
Methods inherited from interface org.apache.qpid.protonj2.codec.decoders.PrimitiveTypeDecoder
isJavaPrimitive
-
Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
getTypeClass, isArrayType, readArrayElements
-
Methods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
isArrayType, readArrayElements
-
-
-
-
Method Detail
-
getTypeCode
public int getTypeCode()
- Returns:
- the AMQP Encoding Code that this primitive type decoder can read.
-
readSize
public int readSize(ProtonBuffer buffer) throws DecodeException
Description copied from interface:BinaryTypeDecoder
Reads the encoded size value for the encoded binary payload and returns it. The read is destructive and theTypeDecoder
read methods cannot be called after this unless theProtonBuffer
is reset via a position marker. This method can be useful when the caller intends to manually read the binary payload from the givenProtonBuffer
.- Specified by:
readSize
in interfaceBinaryTypeDecoder
- Specified by:
readSize
in classAbstractBinaryTypeDecoder
- Parameters:
buffer
- the buffer from which the binary encoded size should be read.- Returns:
- the size of the binary payload that is encoded in the given
ProtonBuffer
. - Throws:
DecodeException
- if an error occurs while reading the binary size.
-
readSize
public int readSize(InputStream stream)
Description copied from interface:BinaryTypeDecoder
Reads the encoded size value for the encoded binary payload and returns it. The read is destructive and theTypeDecoder
read methods cannot be called after this unless theInputStream
is reset via a position marker. This method can be useful when the caller intends to manually read the binary payload from the givenInputStream
.- Specified by:
readSize
in interfaceBinaryTypeDecoder
- Specified by:
readSize
in classAbstractBinaryTypeDecoder
- Parameters:
stream
- the stream from which the binary encoded size should be read.- Returns:
- the size of the binary payload that is encoded in the given
InputStream
.
-
-