Interface BinaryTypeDecoder
-
- All Superinterfaces:
PrimitiveTypeDecoder<Binary>
,StreamTypeDecoder<Binary>
,TypeDecoder<Binary>
- All Known Implementing Classes:
AbstractBinaryTypeDecoder
,Binary32TypeDecoder
,Binary8TypeDecoder
public interface BinaryTypeDecoder extends PrimitiveTypeDecoder<Binary>
Base for all Binary type value decoders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Class<Binary>
getTypeClass()
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 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 Detail
-
getTypeClass
default Class<Binary> getTypeClass()
- Specified by:
getTypeClass
in interfaceStreamTypeDecoder<Binary>
- Specified by:
getTypeClass
in interfaceTypeDecoder<Binary>
- Returns:
- the Class that this decoder handles.
-
readSize
int readSize(ProtonBuffer buffer) throws DecodeException
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
int readSize(InputStream stream) throws DecodeException
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.
-
-