public class BinaryFILEReader extends Object implements Closeable
Constructor and Description |
---|
BinaryFILEReader(InputStream stream,
MessageListener listener)
Create a BinaryFILE reader.
|
BinaryFILEReader(ReadableByteChannel channel,
MessageListener listener)
Create a BinaryFILE reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying channel.
|
static BinaryFILEReader |
open(File file,
MessageListener listener)
Open a BinaryFILE reader.
|
int |
read()
Read messages.
|
public BinaryFILEReader(InputStream stream, MessageListener listener)
stream
- an input streamlistener
- a message listenerpublic BinaryFILEReader(ReadableByteChannel channel, MessageListener listener)
channel
- an input channellistener
- a message listenerpublic static BinaryFILEReader open(File file, MessageListener listener) throws IOException
file
- the input filelistener
- the message listenerIOException
- if an I/O error occurspublic int read() throws IOException
-1
if the channel has reached end-of-streamIOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an I/O error occursCopyright © 2017. All rights reserved.