Class FileEventStream

    • Constructor Detail

      • FileEventStream

        public FileEventStream​(String fileName,
                               String encoding)
                        throws IOException
        Instantiates a FileEventStream from the specified file name.
        Parameters:
        fileName - The name fo the file containing the events.
        encoding - The name of the character encoding.
        Throws:
        IOException - Thrown if the specified file can not be read.
      • FileEventStream

        public FileEventStream​(String fileName)
                        throws IOException
        Instantiates a FileEventStream from the specified file name.
        Parameters:
        fileName - The name fo the file containing the events.
        Throws:
        IOException - Thrown if the specified file can not be read.
    • Method Detail

      • read

        public Event read()
                   throws IOException
        Description copied from interface: ObjectStream
        Returns the next ObjectStream object. Calling this method repeatedly until it returns null will return each object from the underlying source exactly once.
        Specified by:
        read in interface ObjectStream<Event>
        Returns:
        The next object or null to signal that the stream is exhausted.
        Throws:
        IOException - Thrown if there is an error during reading.
      • toLine

        public static String toLine​(Event event)
        Generates a string representing the specified event.
        Parameters:
        event - The Event for which a string representation is needed.
        Returns:
        A string representing the specified event.
      • reset

        public void reset()
                   throws IOException,
                          UnsupportedOperationException
        Description copied from interface: ObjectStream
        Repositions the stream at the beginning and the previously seen object sequence will be repeated exactly. This method can be used to re-read the stream if multiple passes over the objects are required.

        The implementation of this method is optional.

        Specified by:
        reset in interface ObjectStream<Event>
        Throws:
        IOException - Thrown if there is an error during resetting the stream.
        UnsupportedOperationException - Thrown if the reset() is not supported. By default, this is the case.