Class XmppStreamDecoder

  • All Implemented Interfaces:
    ReaderInterceptor

    public final class XmppStreamDecoder
    extends Object
    implements ReaderInterceptor
    Decodes a stream of byte buffers to XMPP elements.

    Decoding is thread-safe, as long as the supplied Unmarshaller is not shared by another thread, e.g. if a thread-local Unmarshaller is supplied.

    Stream restarts can be achieved by using the restart() methods. Decoding and restarts are thread-safe, i.e. can be called by different threads.

    • Constructor Detail

      • XmppStreamDecoder

        public XmppStreamDecoder​(Function<Locale,​javax.xml.bind.Unmarshaller> unmarshaller)
        Creates the XMPP decoder.

        Because Unmarshaller is not thread-safe, it is recommended to pass a ThreadLocal<Unmarshaller> to this constructor, which ensures thread-safety during unmarshalling.

        Parameters:
        unmarshaller - Supplies the unmarshaller which will convert XML to objects.