Interface BinaryTypeDecoder
- All Superinterfaces:
PrimitiveTypeDecoder<Binary>
,StreamTypeDecoder<Binary>
,TypeDecoder<Binary>
- All Known Implementing Classes:
AbstractBinaryTypeDecoder
,Binary32TypeDecoder
,Binary8TypeDecoder
Base for all Binary type value decoders.
-
Method Summary
Modifier and TypeMethodDescriptionint
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 interface org.apache.qpid.protonj2.codec.decoders.PrimitiveTypeDecoder
getTypeCode, isJavaPrimitive
Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
isArrayType, readArrayElements, readValue, skipValue
Methods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
isArrayType, readArrayElements, readValue, skipValue
-
Method Details
-
getTypeClass
- Specified by:
getTypeClass
in interfaceStreamTypeDecoder<Binary>
- Specified by:
getTypeClass
in interfaceTypeDecoder<Binary>
- Returns:
- the Class that this decoder handles.
-
readSize
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
.- 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
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
.- 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
. - Throws:
DecodeException
- if an error occurs while reading the binary size.
-