Class Stream<T>

  • Type Parameters:
    T - type to decode events into

    public class Stream<T>
    extends Object
    Stitch stream that sits on top of an EventStream. Clean interface to read events from a stream as some type T.
    • Method Detail

      • nextEvent

        public StitchEvent<T> nextEvent()
                                 throws IOException
        Fetch the next event from a given stream
        Returns:
        the next event
        Throws:
        IOException - any io exception that could occur
      • isOpen

        public boolean isOpen()
        Whether or not the underlying event straem is still open.
        Returns:
        true is open, false if not
      • close

        public void close()
                   throws IOException
        Close the underlying event stream.
        Throws:
        IOException - i/o exceptions relative to closing
      • cancel

        public void cancel()
        Close the underlying connection to the event stream.