Class AbstractSymbolTypeDecoder
- All Implemented Interfaces:
SymbolTypeDecoder
,PrimitiveTypeDecoder<Symbol>
,StreamTypeDecoder<Symbol>
,TypeDecoder<Symbol>
- Direct Known Subclasses:
Symbol32TypeDecoder
,Symbol8TypeDecoder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
readSize
(InputStream stream) Subclasses must read the correct number of bytes from the buffer to determine the size of the encoded Symbol value.protected abstract int
readSize
(ProtonBuffer buffer) Subclasses must read the correct number of bytes from the buffer to determine the size of the encoded Symbol value.readString
(InputStream stream, StreamDecoderState state) Reads a String view of an encoded Symbol value from the given buffer.readString
(ProtonBuffer buffer, DecoderState state) Reads a String view of an encoded Symbol value from the given buffer.readValue
(InputStream stream, StreamDecoderState state) Reads the next type from the given buffer and returns it.readValue
(ProtonBuffer buffer, DecoderState state) Reads the next type from the given buffer and returns it.void
skipValue
(InputStream stream, StreamDecoderState state) Skips over the bytes that compose the type this descriptor decodes.void
skipValue
(ProtonBuffer buffer, DecoderState state) Skips over the bytes that compose the type this descriptor decodes.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.PrimitiveTypeDecoder
getTypeCode, isJavaPrimitive
Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
getTypeClass, isArrayType, readArrayElements
Methods inherited from interface org.apache.qpid.protonj2.codec.decoders.primitives.SymbolTypeDecoder
getTypeClass
Methods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
isArrayType, readArrayElements
-
Constructor Details
-
AbstractSymbolTypeDecoder
public AbstractSymbolTypeDecoder()
-
-
Method Details
-
readValue
Description copied from interface:TypeDecoder
Reads the next type from the given buffer and returns it.- Specified by:
readValue
in interfaceTypeDecoder<Symbol>
- Parameters:
buffer
- the source of encoded data.state
- the current state of the decoder.- Returns:
- the next instance in the stream that this decoder handles.
- Throws:
DecodeException
- if an error is encountered while reading the next value.
-
readString
Reads a String view of an encoded Symbol value from the given buffer.This method has the same result as calling the Symbol reading variant
readValue(ProtonBuffer, DecoderState)
and then invoking the toString method on the resulting Symbol.- Parameters:
buffer
- The buffer to read the encoded symbol from.state
- The encoder state that applied to this decode operation.- Returns:
- a String view of the encoded Symbol value.
- Throws:
DecodeException
- if an error occurs decoding the Symbol from the given buffer.
-
readValue
Description copied from interface:StreamTypeDecoder
Reads the next type from the given buffer and returns it.- Specified by:
readValue
in interfaceStreamTypeDecoder<Symbol>
- Parameters:
stream
- the source of encoded data.state
- the current state of the decoder.- Returns:
- the next instance in the stream that this decoder handles.
- Throws:
DecodeException
- if an error is encountered while reading the next value.
-
readString
Reads a String view of an encoded Symbol value from the given buffer.This method has the same result as calling the Symbol reading variant
readValue(ProtonBuffer, DecoderState)
and then invoking the toString method on the resulting Symbol.- Parameters:
stream
- The InputStream to read the encoded symbol from.state
- The encoder state that applied to this decode operation.- Returns:
- a String view of the encoded Symbol value.
- Throws:
DecodeException
- if an error occurs decoding the Symbol from the given buffer.
-
skipValue
Description copied from interface:TypeDecoder
Skips over the bytes that compose the type this descriptor decodes.Skipping values can be used when the type is not used or processed by the application doing the decoding. An example might be an AMQP message decoder that only needs to decode certain parts of the message and not others.
- Specified by:
skipValue
in interfaceTypeDecoder<Symbol>
- Parameters:
buffer
- The buffer that contains the encoded type.state
- The decoder state.- Throws:
DecodeException
- if an error occurs while skipping the value.
-
skipValue
Description copied from interface:StreamTypeDecoder
Skips over the bytes that compose the type this descriptor decodes.Skipping values can be used when the type is not used or processed by the application doing the decoding. An example might be an AMQP message decoder that only needs to decode certain parts of the message and not others.
- Specified by:
skipValue
in interfaceStreamTypeDecoder<Symbol>
- Parameters:
stream
- The stream that contains the encoded type.state
- The decoder state.- Throws:
DecodeException
- if an error occurs while skipping the value.
-
readSize
Subclasses must read the correct number of bytes from the buffer to determine the size of the encoded Symbol value.- Parameters:
buffer
- The buffer to read the size from.- Returns:
- the number of bytes that make up the encoded Symbol value.
- Throws:
DecodeException
- if an error occurs reading the size value.
-
readSize
Subclasses must read the correct number of bytes from the buffer to determine the size of the encoded Symbol value.- Parameters:
stream
- The InputStream to read the size from.- Returns:
- the number of bytes that make up the encoded Symbol value.
- Throws:
DecodeException
- if an error occurs reading the size value.
-