public class FileEventStream extends java.lang.Object implements ObjectStream<Event>
Constructor and Description |
---|
FileEventStream(java.io.File file)
Creates a new file event stream from the specified file.
|
FileEventStream(java.lang.String fileName) |
FileEventStream(java.lang.String fileName,
java.lang.String encoding)
Creates a new file event stream from the specified file name.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
ObjectStream and releases all allocated
resources. |
Event |
read()
Returns the next object.
|
void |
reset()
Repositions the stream at the beginning and the previously seen object sequence
will be repeated exactly.
|
static java.lang.String |
toLine(Event event)
Generates a string representing the specified event.
|
public FileEventStream(java.lang.String fileName, java.lang.String encoding) throws java.io.IOException
fileName
- the name fo the file containing the events.java.io.IOException
- When the specified file can not be read.public FileEventStream(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public FileEventStream(java.io.File file) throws java.io.IOException
file
- the file containing the events.java.io.IOException
- When the specified file can not be read.public Event read() throws java.io.IOException
ObjectStream
read
in interface ObjectStream<Event>
java.io.IOException
- if there is an error during readingpublic void close() throws java.io.IOException
ObjectStream
ObjectStream
and releases all allocated
resources. After close was called its not allowed to call
read or reset.close
in interface java.lang.AutoCloseable
close
in interface ObjectStream<Event>
java.io.IOException
- if there is an error during closing the streampublic static java.lang.String toLine(Event event)
event
- The event for which a string representation is needed.public void reset() throws java.io.IOException, java.lang.UnsupportedOperationException
ObjectStream
reset
in interface ObjectStream<Event>
java.io.IOException
- if there is an error during reseting the streamjava.lang.UnsupportedOperationException
Copyright © 2010 - 2020 Adobe. All Rights Reserved