Class ProtonDecoder
java.lang.Object
org.apache.qpid.protonj2.codec.decoders.ProtonDecoder
- All Implemented Interfaces:
- Decoder
The default AMQP Decoder implementation.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn a singletonDecoderStateinstance that is meant to be shared within single threaded decoder interactions.Creates a newDecoderStateinstance that can be used when interacting with the Decoder.TypeDecoder<?>peekNextTypeDecoder(ProtonBuffer buffer, DecoderState state) Peeks ahead in the givenProtonBufferinstance and returns aTypeDecoderthat can read the next encoded AMQP type from the buffer's bytes.readBinary(ProtonBuffer buffer, DecoderState state) Reads an encodedBinaryvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readBinaryAsBuffer(ProtonBuffer buffer, DecoderState state) Reads an encodedBinaryvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readBoolean(ProtonBuffer buffer, DecoderState state) Reads an encodedBooleanvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.booleanreadBoolean(ProtonBuffer buffer, DecoderState state, boolean defaultValue) Reads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readByte(ProtonBuffer buffer, DecoderState state) Reads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.bytereadByte(ProtonBuffer buffer, DecoderState state, byte defaultValue) Reads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readCharacter(ProtonBuffer buffer, DecoderState state) Reads an encodedCharactervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.charreadCharacter(ProtonBuffer buffer, DecoderState state, char defaultValue) Reads an encodedCharactervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readDecimal128(ProtonBuffer buffer, DecoderState state) Reads an encodedDecimal128value from the givenProtonBufferassuming that the next value in the byte stream is that type.readDecimal32(ProtonBuffer buffer, DecoderState state) Reads an encodedDecimal32value from the givenProtonBufferassuming that the next value in the byte stream is that type.readDecimal64(ProtonBuffer buffer, DecoderState state) Reads an encodedDecimal64value from the givenProtonBufferassuming that the next value in the byte stream is that type.readDeliveryTag(ProtonBuffer buffer, DecoderState state) This method expects to read aBinaryencoded type from the provided buffer and constructs aDeliveryTagtype that wraps the bytes encoded.readDouble(ProtonBuffer buffer, DecoderState state) Reads an encodedDoublevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.doublereadDouble(ProtonBuffer buffer, DecoderState state, double defaultValue) Reads an encodedDoublevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readFloat(ProtonBuffer buffer, DecoderState state) Reads an encodedFloatvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.floatreadFloat(ProtonBuffer buffer, DecoderState state, float defaultValue) Reads an encodedFloatvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readInteger(ProtonBuffer buffer, DecoderState state) Reads an encodedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.intreadInteger(ProtonBuffer buffer, DecoderState state, int defaultValue) Reads an encodedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.<V> List<V>readList(ProtonBuffer buffer, DecoderState state) Reads an encodedListvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readLong(ProtonBuffer buffer, DecoderState state) Reads an encodedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.longreadLong(ProtonBuffer buffer, DecoderState state, long defaultValue) Reads an encodedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.<K,V> Map<K, V> readMap(ProtonBuffer buffer, DecoderState state) Reads an encodedMapvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.<T> T[]readMultiple(ProtonBuffer buffer, DecoderState state, Class<T> clazz) Reads one or more encoded values from the givenProtonBufferan return it as an array ofObjectinstances which the caller must then interpret.TypeDecoder<?>readNextTypeDecoder(ProtonBuffer buffer, DecoderState state) Reads from the givenProtonBufferinstance and returns aTypeDecoderthat can read the next encoded AMQP type from the buffer's bytes.readObject(ProtonBuffer buffer, DecoderState state) Reads an encoded value from the givenProtonBufferan return it as anObjectwhich the caller must then interpret.<T> TreadObject(ProtonBuffer buffer, DecoderState state, Class<T> clazz) Reads an encoded value from the givenProtonBufferan return it as anObjectwhich the caller must then interpret.readShort(ProtonBuffer buffer, DecoderState state) Reads an encodedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.shortreadShort(ProtonBuffer buffer, DecoderState state, short defaultValue) Reads an encodedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readString(ProtonBuffer buffer, DecoderState state) Reads an encodedStringvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readSymbol(ProtonBuffer buffer, DecoderState state) Reads an encodedSymbolvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readSymbol(ProtonBuffer buffer, DecoderState state, String defaultValue) Reads an encodedStringvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readTimestamp(ProtonBuffer buffer, DecoderState state) Reads an encoded AMQP time stamp value from the givenProtonBufferassuming that the next value in the byte stream is that type.longreadTimestamp(ProtonBuffer buffer, DecoderState state, long defaultValue) Reads an encoded AMQP time stamp value from the givenProtonBufferassuming that the next value in the byte stream is that type.readUnsignedByte(ProtonBuffer buffer, DecoderState state) Reads an encodedUnsignedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.bytereadUnsignedByte(ProtonBuffer buffer, DecoderState state, byte defaultValue) Reads an encodedUnsignedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readUnsignedInteger(ProtonBuffer buffer, DecoderState state) Reads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.intreadUnsignedInteger(ProtonBuffer buffer, DecoderState state, int defaultValue) Reads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.longreadUnsignedInteger(ProtonBuffer buffer, DecoderState state, long defaultValue) Reads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readUnsignedLong(ProtonBuffer buffer, DecoderState state) Reads an encodedUnsignedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.longreadUnsignedLong(ProtonBuffer buffer, DecoderState state, long defaultValue) Reads an encodedUnsignedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readUnsignedShort(ProtonBuffer buffer, DecoderState state) Reads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.intreadUnsignedShort(ProtonBuffer buffer, DecoderState state, int defaultValue) Reads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.shortreadUnsignedShort(ProtonBuffer buffer, DecoderState state, short defaultValue) Reads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.readUUID(ProtonBuffer buffer, DecoderState state) Reads an encodedUUIDvalue from the givenProtonBufferassuming that the next value in the byte stream is that type.<V> ProtonDecoderregisterDescribedTypeDecoder(DescribedTypeDecoder<V> decoder) Allows customDescribedTypeDecoderinstances to be registered with thisDecoderwhich will be used if the described type encoding is encountered during decode operations.
- 
Constructor Details- 
ProtonDecoderpublic ProtonDecoder()
 
- 
- 
Method Details- 
newDecoderStateDescription copied from interface:DecoderCreates a newDecoderStateinstance that can be used when interacting with the Decoder. For decoding that occurs on more than one thread while sharing a singleDecoderinstance a different state object per thread is required as theDecoderStateobject can retain some state information during the decode process that could be corrupted if more than one thread were to share a single instance. For single threaded decoding work theDecoderoffers a utility cachedDecoderStateAPI that will return the same instance on each call which can reduce allocation overhead and make using theDecodersimpler.- Specified by:
- newDecoderStatein interface- Decoder
- Returns:
- a newly constructed EncoderStateinstance.
 
- 
getCachedDecoderStateDescription copied from interface:DecoderReturn a singletonDecoderStateinstance that is meant to be shared within single threaded decoder interactions. If more than one thread makes use of this cachedDecoderStatethe results of any decoding done using this state object is not guaranteed to be correct. The returned instance will have its reset method called to ensure that any previously stored state data is cleared before the next use.- Specified by:
- getCachedDecoderStatein interface- Decoder
- Returns:
- a cached DecoderStatelinked to this Decoder instance that has been reset.
 
- 
readObjectDescription copied from interface:DecoderReads an encoded value from the givenProtonBufferan return it as anObjectwhich the caller must then interpret.- Specified by:
- readObjectin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not able to be decoded.
 
- 
readObjectpublic <T> T readObject(ProtonBuffer buffer, DecoderState state, Class<T> clazz) throws DecodeException Description copied from interface:DecoderReads an encoded value from the givenProtonBufferan return it as anObjectwhich the caller must then interpret.- Specified by:
- readObjectin interface- Decoder
- Type Parameters:
- T- the type that will be used when casting and returning the decoded value.
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- clazz- The- Classtype that should be used to cast the returned value.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not able to be decoded.
 
- 
readMultiplepublic <T> T[] readMultiple(ProtonBuffer buffer, DecoderState state, Class<T> clazz) throws DecodeException Description copied from interface:DecoderReads one or more encoded values from the givenProtonBufferan return it as an array ofObjectinstances which the caller must then interpret.- Specified by:
- readMultiplein interface- Decoder
- Type Parameters:
- T- the type that will be used when casting and returning the decoded value.
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- clazz- The- Classtype that should be used to cast the returned array.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not able to be decoded.
 
- 
readNextTypeDecoderpublic TypeDecoder<?> readNextTypeDecoder(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads from the givenProtonBufferinstance and returns aTypeDecoderthat can read the next encoded AMQP type from the buffer's bytes. If an error occurs attempting to read and determine the next type decoder anDecodeExceptionis thrown.- Specified by:
- readNextTypeDecoderin interface- Decoder
- Parameters:
- buffer- The buffer to read from to determine the next- TypeDecoderneeded.
- state- The- DecoderStatevalue that can be used for intermediate decoding tasks.
- Returns:
- a TypeDecoderinstance that can read the next type in the buffer.
- Throws:
- DecodeException- if an error occurs while reading the next type decoder.
 
- 
peekNextTypeDecoderpublic TypeDecoder<?> peekNextTypeDecoder(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderPeeks ahead in the givenProtonBufferinstance and returns aTypeDecoderthat can read the next encoded AMQP type from the buffer's bytes. If an error occurs attempting to read and determine the next type decoder anDecodeExceptionis thrown. The underlying buffer is not modified as a result of the peek operation and the returnedTypeDecoderwill fail to properly read the type until the encoding bytes are read.- Specified by:
- peekNextTypeDecoderin interface- Decoder
- Parameters:
- buffer- The buffer to read from to determine the next- TypeDecoderneeded.
- state- The- DecoderStatevalue that can be used for intermediate decoding tasks.
- Returns:
- a TypeDecoderinstance that can provide insight into the next type in the buffer.
- Throws:
- DecodeException- if an error occurs while peeking ahead for the next type decoder.
 
- 
registerDescribedTypeDecoderDescription copied from interface:DecoderAllows customDescribedTypeDecoderinstances to be registered with thisDecoderwhich will be used if the described type encoding is encountered during decode operations.- Specified by:
- registerDescribedTypeDecoderin interface- Decoder
- Type Parameters:
- V- The type that the decoder reads.
- Parameters:
- decoder- A- DescribedTypeDecoderinstance to be registered with this- Decoder
- Returns:
- this Decoderinstance.
 
- 
readBooleanDescription copied from interface:DecoderReads an encodedBooleanvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readBooleanin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readBooleanpublic boolean readBoolean(ProtonBuffer buffer, DecoderState state, boolean defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readBooleanin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readByteDescription copied from interface:DecoderReads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readBytein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readBytepublic byte readByte(ProtonBuffer buffer, DecoderState state, byte defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readBytein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedBytepublic UnsignedByte readUnsignedByte(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedBytein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedBytepublic byte readUnsignedByte(ProtonBuffer buffer, DecoderState state, byte defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedBytevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedBytein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readCharacterDescription copied from interface:DecoderReads an encodedCharactervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readCharacterin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readCharacterpublic char readCharacter(ProtonBuffer buffer, DecoderState state, char defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedCharactervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readCharacterin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDecimal32Description copied from interface:DecoderReads an encodedDecimal32value from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readDecimal32in interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDecimal64Description copied from interface:DecoderReads an encodedDecimal64value from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readDecimal64in interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDecimal128Description copied from interface:DecoderReads an encodedDecimal128value from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readDecimal128in interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readShortDescription copied from interface:DecoderReads an encodedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readShortin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readShortpublic short readShort(ProtonBuffer buffer, DecoderState state, short defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readShortin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedShortpublic UnsignedShort readUnsignedShort(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedShortpublic short readUnsignedShort(ProtonBuffer buffer, DecoderState state, short defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedShortpublic int readUnsignedShort(ProtonBuffer buffer, DecoderState state, int defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedShortvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readIntegerDescription copied from interface:DecoderReads an encodedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readIntegerin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readIntegerpublic int readInteger(ProtonBuffer buffer, DecoderState state, int defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readIntegerin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedIntegerpublic UnsignedInteger readUnsignedInteger(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedIntegerpublic int readUnsignedInteger(ProtonBuffer buffer, DecoderState state, int defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedIntegerpublic long readUnsignedInteger(ProtonBuffer buffer, DecoderState state, long defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedIntegervalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readLongDescription copied from interface:DecoderReads an encodedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readLongin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readLongpublic long readLong(ProtonBuffer buffer, DecoderState state, long defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readLongin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedLongpublic UnsignedLong readUnsignedLong(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedLongin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUnsignedLongpublic long readUnsignedLong(ProtonBuffer buffer, DecoderState state, long defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedUnsignedLongvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUnsignedLongin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readFloatDescription copied from interface:DecoderReads an encodedFloatvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readFloatin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readFloatpublic float readFloat(ProtonBuffer buffer, DecoderState state, float defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedFloatvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readFloatin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDoubleDescription copied from interface:DecoderReads an encodedDoublevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readDoublein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDoublepublic double readDouble(ProtonBuffer buffer, DecoderState state, double defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedDoublevalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readDoublein interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readBinaryDescription copied from interface:DecoderReads an encodedBinaryvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position the and reset the input to make a further read attempt.The resulting Binaryinstance will contain a read-only view of the decoded bytes and any calls to access the underlying buffer will return a read-onlyProtonBuffer.- Specified by:
- readBinaryin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readBinaryAsBufferpublic ProtonBuffer readBinaryAsBuffer(ProtonBuffer buffer, DecoderState state) throws DecodeException Description copied from interface:DecoderReads an encodedBinaryvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.The resulting ProtonBufferwill be a read-only view of the bytes read and to maximize performance the incoming buffer being decoded should also be read only otherwise the result is likely to be a deep copy of the source bytes.- Specified by:
- readBinaryAsBufferin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source and returned in a ProtonBuffer.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readDeliveryTagDescription copied from interface:DecoderThis method expects to read aBinaryencoded type from the provided buffer and constructs aDeliveryTagtype that wraps the bytes encoded. If the encoding is a NULL AMQP type then this method returnsnull.- Specified by:
- readDeliveryTagin interface- Decoder
- Parameters:
- buffer- The buffer to read a Binary encoded value from
- state- The current encoding state.
- Returns:
- a new DeliveryTag instance or null if an AMQP NULL encoding is found.
- Throws:
- DecodeException- if an error occurs while decoding the- DeliveryTaginstance.
 
- 
readStringDescription copied from interface:DecoderReads an encodedStringvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readStringin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readSymbolDescription copied from interface:DecoderReads an encodedSymbolvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readSymbolin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readSymbolpublic String readSymbol(ProtonBuffer buffer, DecoderState state, String defaultValue) throws DecodeException Description copied from interface:DecoderReads an encodedStringvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readSymbolin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readTimestampDescription copied from interface:DecoderReads an encoded AMQP time stamp value from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readTimestampin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source and return a Longwith the time value.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readTimestamppublic long readTimestamp(ProtonBuffer buffer, DecoderState state, long defaultValue) throws DecodeException Description copied from interface:DecoderReads an encoded AMQP time stamp value from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readTimestampin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- defaultValue- A default value to return if the next encoded value is a Null encoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readUUIDDescription copied from interface:DecoderReads an encodedUUIDvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readUUIDin interface- Decoder
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readMapDescription copied from interface:DecoderReads an encodedMapvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readMapin interface- Decoder
- Type Parameters:
- K- The key type for the map that is being read.
- V- The value type for the map that is being read.
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
- 
readListDescription copied from interface:DecoderReads an encodedListvalue from the givenProtonBufferassuming that the next value in the byte stream is that type. The operation fails if the next encoded type is not what was expected. If the caller wishes to recover from failed decode attempt they should make a note of the current read position and reset the input to make a further read attempt.- Specified by:
- readListin interface- Decoder
- Type Parameters:
- V- The value type for the list being read.
- Parameters:
- buffer- The- ProtonBufferwhere the read operation takes place.
- state- The- DecoderStatethat the decoder can use when decoding.
- Returns:
- the value read from the provided byte source.
- Throws:
- DecodeException- if the value fails to decode is not of the expected type,
 
 
-