Class ProtonStreamDecoder
- java.lang.Object
- 
- org.apache.qpid.protonj2.codec.decoders.ProtonStreamDecoder
 
- 
- All Implemented Interfaces:
- StreamDecoder
 
 public final class ProtonStreamDecoder extends Object implements StreamDecoder The default AMQP Decoder implementation.
- 
- 
Constructor SummaryConstructors Constructor Description ProtonStreamDecoder()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtonStreamDecoderStategetCachedDecoderState()Return a singletonStreamDecoderStateinstance that is meant to be shared within single threaded decoder interactions.ProtonStreamDecoderStatenewDecoderState()Creates a newStreamDecoderStateinstance that can be used when interacting with the Decoder.StreamTypeDecoder<?>peekNextTypeDecoder(InputStream stream, StreamDecoderState state)Peeks ahead in the givenInputStreaminstance and returns aTypeDecoderthat can read the next encoded AMQP type from the stream's bytes.BinaryreadBinary(InputStream stream, StreamDecoderState state)Reads an encodedBinaryvalue from the givenInputStreamassuming that the next value in the byte stream is that type.ProtonBufferreadBinaryAsBuffer(InputStream stream, StreamDecoderState state)Reads an encodedBinaryvalue from the givenInputStreamassuming that the next value in the byte stream is that type.BooleanreadBoolean(InputStream stream, StreamDecoderState state)Reads an encodedBooleanvalue from the givenInputStreamassuming that the next value in the byte stream is that type.booleanreadBoolean(InputStream stream, StreamDecoderState state, boolean defaultValue)Reads an encodedBytevalue from the givenInputStreamassuming that the next value in the byte stream is that type.BytereadByte(InputStream stream, StreamDecoderState state)Reads an encodedBytevalue from the givenInputStreamassuming that the next value in the byte stream is that type.bytereadByte(InputStream stream, StreamDecoderState state, byte defaultValue)Reads an encodedBytevalue from the givenInputStreamassuming that the next value in the byte stream is that type.CharacterreadCharacter(InputStream stream, StreamDecoderState state)Reads an encodedCharactervalue from the givenInputStreamassuming that the next value in the byte stream is that type.charreadCharacter(InputStream stream, StreamDecoderState state, char defaultValue)Reads an encodedCharactervalue from the givenInputStreamassuming that the next value in the byte stream is that type.Decimal128readDecimal128(InputStream stream, StreamDecoderState state)Reads an encodedDecimal128value from the givenInputStreamassuming that the next value in the byte stream is that type.Decimal32readDecimal32(InputStream stream, StreamDecoderState state)Reads an encodedDecimal32value from the givenInputStreamassuming that the next value in the byte stream is that type.Decimal64readDecimal64(InputStream stream, StreamDecoderState state)Reads an encodedDecimal64value from the givenInputStreamassuming that the next value in the byte stream is that type.DeliveryTagreadDeliveryTag(InputStream stream, StreamDecoderState state)This method expects to read aBinaryencoded type from the provided stream and constructs aDeliveryTagtype that wraps the bytes encoded.DoublereadDouble(InputStream stream, StreamDecoderState state)Reads an encodedDoublevalue from the givenInputStreamassuming that the next value in the byte stream is that type.doublereadDouble(InputStream stream, StreamDecoderState state, double defaultValue)Reads an encodedDoublevalue from the givenInputStreamassuming that the next value in the byte stream is that type.FloatreadFloat(InputStream stream, StreamDecoderState state)Reads an encodedFloatvalue from the givenInputStreamassuming that the next value in the byte stream is that type.floatreadFloat(InputStream stream, StreamDecoderState state, float defaultValue)Reads an encodedFloatvalue from the givenInputStreamassuming that the next value in the byte stream is that type.IntegerreadInteger(InputStream stream, StreamDecoderState state)Reads an encodedIntegervalue from the givenInputStreamassuming that the next value in the byte stream is that type.intreadInteger(InputStream stream, StreamDecoderState state, int defaultValue)Reads an encodedIntegervalue from the givenInputStreamassuming that the next value in the byte stream is that type.<V> List<V>readList(InputStream stream, StreamDecoderState state)Reads an encodedListvalue from the givenInputStreamassuming that the next value in the byte stream is that type.LongreadLong(InputStream stream, StreamDecoderState state)Reads an encodedLongvalue from the givenInputStreamassuming that the next value in the byte stream is that type.longreadLong(InputStream stream, StreamDecoderState state, long defaultValue)Reads an encodedLongvalue from the givenInputStreamassuming that the next value in the byte stream is that type.<K,V>
 Map<K,V>readMap(InputStream stream, StreamDecoderState state)Reads an encodedMapvalue from the givenInputStreamassuming that the next value in the byte stream is that type.<T> T[]readMultiple(InputStream stream, StreamDecoderState state, Class<T> clazz)Reads one or more encoded values from the givenInputStreaman return it as an array ofObjectinstances which the caller must then interpret.StreamTypeDecoder<?>readNextTypeDecoder(InputStream stream, StreamDecoderState state)Reads from the givenInputStreaminstance and returns aStreamTypeDecoderthat can read the next encoded AMQP type from the stream's bytes.ObjectreadObject(InputStream stream, StreamDecoderState state)Reads an encoded value from the givenInputStreaman return it as anObjectwhich the caller must then interpret.<T> TreadObject(InputStream stream, StreamDecoderState state, Class<T> clazz)Reads an encoded value from the givenInputStreaman return it as anObjectwhich the caller must then interpret.ShortreadShort(InputStream stream, StreamDecoderState state)Reads an encodedShortvalue from the givenInputStreamassuming that the next value in the byte stream is that type.shortreadShort(InputStream stream, StreamDecoderState state, short defaultValue)Reads an encodedShortvalue from the givenInputStreamassuming that the next value in the byte stream is that type.StringreadString(InputStream stream, StreamDecoderState state)Reads an encodedStringvalue from the givenInputStreamassuming that the next value in the byte stream is that type.SymbolreadSymbol(InputStream stream, StreamDecoderState state)Reads an encodedSymbolvalue from the givenInputStreamassuming that the next value in the byte stream is that type.StringreadSymbol(InputStream stream, StreamDecoderState state, String defaultValue)Reads an encodedStringvalue from the givenInputStreamassuming that the next value in the byte stream is that type.LongreadTimestamp(InputStream stream, StreamDecoderState state)Reads an encoded AMQP time stamp value from the givenInputStreamassuming that the next value in the byte stream is that type.longreadTimestamp(InputStream stream, StreamDecoderState state, long defaultValue)Reads an encoded AMQP time stamp value from the givenInputStreamassuming that the next value in the byte stream is that type.UnsignedBytereadUnsignedByte(InputStream stream, StreamDecoderState state)Reads an encodedUnsignedBytevalue from the givenInputStreamassuming that the next value in the byte stream is that type.bytereadUnsignedByte(InputStream stream, StreamDecoderState state, byte defaultValue)Reads an encodedUnsignedBytevalue from the givenInputStreamassuming that the next value in the byte stream is that type.UnsignedIntegerreadUnsignedInteger(InputStream stream, StreamDecoderState state)Reads an encodedUnsignedIntegervalue from the givenInputStreamassuming that the next value in the byte stream is that type.intreadUnsignedInteger(InputStream stream, StreamDecoderState state, int defaultValue)Reads an encodedUnsignedIntegervalue from the givenInputStreamassuming that the next value in the byte stream is that type.longreadUnsignedInteger(InputStream stream, StreamDecoderState state, long defaultValue)Reads an encodedUnsignedIntegervalue from the givenInputStreamassuming that the next value in the byte stream is that type.UnsignedLongreadUnsignedLong(InputStream stream, StreamDecoderState state)Reads an encodedUnsignedLongvalue from the givenInputStreamassuming that the next value in the byte stream is that type.longreadUnsignedLong(InputStream stream, StreamDecoderState state, long defaultValue)Reads an encodedUnsignedLongvalue from the givenInputStreamassuming that the next value in the byte stream is that type.UnsignedShortreadUnsignedShort(InputStream stream, StreamDecoderState state)Reads an encodedUnsignedShortvalue from the givenInputStreamassuming that the next value in the byte stream is that type.intreadUnsignedShort(InputStream stream, StreamDecoderState state, int defaultValue)Reads an encodedUnsignedShortvalue from the givenInputStreamassuming that the next value in the byte stream is that type.shortreadUnsignedShort(InputStream stream, StreamDecoderState state, short defaultValue)Reads an encodedUnsignedShortvalue from the givenInputStreamassuming that the next value in the byte stream is that type.UUIDreadUUID(InputStream stream, StreamDecoderState state)Reads an encodedUUIDvalue from the givenInputStreamassuming that the next value in the byte stream is that type.<V> ProtonStreamDecoderregisterDescribedTypeDecoder(StreamDescribedTypeDecoder<V> decoder)Allows customStreamDescribedTypeDecoderinstances to be registered with thisStreamDecoderwhich will be used if the described type encoding is encountered during decode operations.
 
- 
- 
- 
Method Detail- 
newDecoderStatepublic ProtonStreamDecoderState newDecoderState() Description copied from interface:StreamDecoderCreates a newStreamDecoderStateinstance that can be used when interacting with the Decoder. For decoding that occurs on more than one thread while sharing a singleStreamDecoderinstance a different state object per thread is required as theStreamDecoderStateobject 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 theStreamDecoderoffers a utility cachedStreamDecoderStateAPI that will return the same instance on each call which can reduce allocation overhead and make using theStreamDecodersimpler.- Specified by:
- newDecoderStatein interface- StreamDecoder
- Returns:
- a newly constructed EncoderStateinstance.
 
 - 
getCachedDecoderStatepublic ProtonStreamDecoderState getCachedDecoderState() Description copied from interface:StreamDecoderReturn a singletonStreamDecoderStateinstance that is meant to be shared within single threaded decoder interactions. If more than one thread makes use of this cachedStreamDecoderStatethe 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- StreamDecoder
- Returns:
- a cached StreamDecoderStatelinked to this Decoder instance that has been reset.
 
 - 
readObjectpublic Object readObject(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encoded value from the givenInputStreaman return it as anObjectwhich the caller must then interpret.- Specified by:
- readObjectin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, Class<T> clazz) throws DecodeException Description copied from interface:StreamDecoderReads an encoded value from the givenInputStreaman return it as anObjectwhich the caller must then interpret.- Specified by:
- readObjectin interface- StreamDecoder
- Type Parameters:
- T- the type that will be used when casting and returning the decoded value.
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, Class<T> clazz) throws DecodeException Description copied from interface:StreamDecoderReads one or more encoded values from the givenInputStreaman return it as an array ofObjectinstances which the caller must then interpret.- Specified by:
- readMultiplein interface- StreamDecoder
- Type Parameters:
- T- the type that will be used when casting and returning the decoded value.
- Parameters:
- stream- The- InputStreamwhere 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 StreamTypeDecoder<?> readNextTypeDecoder(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads from the givenInputStreaminstance and returns aStreamTypeDecoderthat can read the next encoded AMQP type from the stream's bytes. If an error occurs attempting to read and determine the next type decoder anDecodeExceptionis thrown.- Specified by:
- readNextTypeDecoderin interface- StreamDecoder
- Parameters:
- stream- The stream to read from to determine the next- TypeDecoderneeded.
- state- The- DecoderStatevalue that can be used for intermediate decoding tasks.
- Returns:
- a StreamTypeDecoderinstance that can read the next type in the stream.
- Throws:
- DecodeException- if an error occurs while reading the next type decoder.
 
 - 
peekNextTypeDecoderpublic StreamTypeDecoder<?> peekNextTypeDecoder(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderPeeks ahead in the givenInputStreaminstance and returns aTypeDecoderthat can read the next encoded AMQP type from the stream's bytes. If an error occurs attempting to read and determine the next type decoder anDecodeExceptionis thrown. The underlying stream 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. If the provided stream does not offer support for the mark API than this method can throw anUnsupportedOperationException.- Specified by:
- peekNextTypeDecoderin interface- StreamDecoder
- Parameters:
- stream- The stream 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 stream.
- Throws:
- DecodeException- if an error occurs while peeking ahead for the next type decoder.
 
 - 
registerDescribedTypeDecoderpublic <V> ProtonStreamDecoder registerDescribedTypeDecoder(StreamDescribedTypeDecoder<V> decoder) Description copied from interface:StreamDecoderAllows customStreamDescribedTypeDecoderinstances to be registered with thisStreamDecoderwhich will be used if the described type encoding is encountered during decode operations.- Specified by:
- registerDescribedTypeDecoderin interface- StreamDecoder
- Type Parameters:
- V- The type that the decoder reads.
- Parameters:
- decoder- A- StreamDescribedTypeDecoderinstance to be registered with this- StreamDecoder
- Returns:
- this StreamDecoderinstance.
 
 - 
readBooleanpublic Boolean readBoolean(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBooleanvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBooleanin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, boolean defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBytevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBooleanin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readBytepublic Byte readByte(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBytevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBytein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, byte defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBytevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBytein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedBytevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedBytein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, byte defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedBytevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedBytein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readCharacterpublic Character readCharacter(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedCharactervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readCharacterin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, char defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedCharactervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readCharacterin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readDecimal32public Decimal32 readDecimal32(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedDecimal32value from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readDecimal32in interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readDecimal64public Decimal64 readDecimal64(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedDecimal64value from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readDecimal64in interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readDecimal128public Decimal128 readDecimal128(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedDecimal128value from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readDecimal128in interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedShortvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readShortin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, short defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedShortvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readShortin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedShortvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, short defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedShortvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, int defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedShortvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedShortin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readIntegerpublic Integer readInteger(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedIntegervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readIntegerin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, int defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedIntegervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readIntegerin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedIntegervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, int defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedIntegervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, long defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedIntegervalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedIntegerin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readLongpublic Long readLong(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedLongvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readLongin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, long defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedLongvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readLongin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedLongvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedLongin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, long defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUnsignedLongvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUnsignedLongin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readFloatpublic Float readFloat(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedFloatvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readFloatin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, float defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedFloatvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readFloatin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readDoublepublic Double readDouble(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedDoublevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readDoublein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, double defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedDoublevalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readDoublein interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readBinarypublic Binary readBinary(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBinaryvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBinaryin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedBinaryvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readBinaryAsBufferin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readDeliveryTagpublic DeliveryTag readDeliveryTag(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderThis method expects to read aBinaryencoded type from the provided stream and constructs aDeliveryTagtype that wraps the bytes encoded. If the encoding is a NULL AMQP type then this method returnsnull.- Specified by:
- readDeliveryTagin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamto 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.
 
 - 
readStringpublic String readString(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedStringvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readStringin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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 Symbol readSymbol(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedSymbolvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readSymbolin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, String defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encodedStringvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readSymbolin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readTimestamppublic Long readTimestamp(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encoded AMQP time stamp value from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readTimestampin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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(InputStream stream, StreamDecoderState state, long defaultValue) throws DecodeException Description copied from interface:StreamDecoderReads an encoded AMQP time stamp value from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readTimestampin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readUUIDpublic UUID readUUID(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedUUIDvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readUUIDin interface- StreamDecoder
- Parameters:
- stream- The- InputStreamwhere 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,
 
 - 
readMappublic <K,V> Map<K,V> readMap(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedMapvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readMapin interface- StreamDecoder
- 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:
- stream- The- InputStreamwhere 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,
 
 - 
readListpublic <V> List<V> readList(InputStream stream, StreamDecoderState state) throws DecodeException Description copied from interface:StreamDecoderReads an encodedListvalue from the givenInputStreamassuming 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 mark the and reset the input to make a further read attempt.- Specified by:
- readListin interface- StreamDecoder
- Type Parameters:
- V- The value type for the list that is being read.
- Parameters:
- stream- The- InputStreamwhere 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,
 
 
- 
 
-