Class ProtonStreamDecoderState

  • All Implemented Interfaces:

    public final class ProtonStreamDecoderState
    extends java.lang.Object
    implements StreamDecoderState
    State object used by the Built in Decoder implementation.
    • Method Detail

      • getStringDecoder

        public UTF8StreamDecoder getStringDecoder()
        the currently set custom UTF-8 String decoder or null if non set.
      • setStringDecoder

        public void setStringDecoder​(UTF8StreamDecoder stringDecoder)
        Sets a custom UTF-8 String decoder that will be used for all String decoding done from the encoder associated with this StreamDecoderState instance. If no decoder is registered then the implementation uses its own decoding algorithm.
        stringDecoder - a custom UTF8Decoder that will be used for all String decoding.
      • decodeUTF8

        public java.lang.String decodeUTF8​( stream,
                                           int length)
                                    throws DecodeException
        Description copied from interface: StreamDecoderState
        Given a stream that will provide UTF-8 encoded bytes, decode and return the String that represents that UTF-8 value.
        Specified by:
        decodeUTF8 in interface StreamDecoderState
        stream - A stream from which the UTF-8 encoded bytes are to be decoded.
        length - The number of bytes in the passed InputStream that comprise the UTF-8 encoding.
        a String that represents the UTF-8 decoded bytes.
        DecodeException - if an error occurs while decoding the string value.