public class FileEventStream extends Object implements ObjectStream<Event>
| Constructor and Description |
|---|
FileEventStream(File file)
Creates a new file event stream from the specified file.
|
FileEventStream(String fileName) |
FileEventStream(String fileName,
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 String |
toLine(Event event)
Generates a string representing the specified event.
|
public FileEventStream(String fileName, String encoding) throws IOException
fileName - the name fo the file containing the events.IOException - When the specified file can not be read.public FileEventStream(String fileName) throws IOException
IOExceptionpublic FileEventStream(File file) throws IOException
file - the file containing the events.IOException - When the specified file can not be read.public Event read() throws IOException
ObjectStreamread in interface ObjectStream<Event>IOException - if there is an error during readingpublic void close()
throws IOException
ObjectStreamObjectStream and releases all allocated
resources. After close was called its not allowed to call
read or reset.close in interface AutoCloseableclose in interface ObjectStream<Event>IOException - if there is an error during closing the streampublic static String toLine(Event event)
event - The event for which a string representation is needed.public void reset()
throws IOException,
UnsupportedOperationException
ObjectStreamreset in interface ObjectStream<Event>IOException - if there is an error during reseting the streamUnsupportedOperationExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.