public class ConcurrentFileReader extends Object implements ReadableByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected SeekableByteChannel |
currentReadChannel |
protected Integer |
pollIntervalInMs |
protected Channel |
referenceChannel |
| Constructor and Description |
|---|
ConcurrentFileReader(Channel writeChannel,
SeekableByteChannel currentReadChannel,
Integer pollIntervalInMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static ConcurrentFileReader |
create(Path path,
Channel writeChannel,
Integer pollIntervalInMs) |
boolean |
isAborted() |
boolean |
isOpen() |
int |
read(ByteBuffer dst)
Read method that blocks if no data is available
but the write channel is still open
|
protected Channel referenceChannel
protected SeekableByteChannel currentReadChannel
protected Integer pollIntervalInMs
public ConcurrentFileReader(Channel writeChannel, SeekableByteChannel currentReadChannel, Integer pollIntervalInMs)
public static ConcurrentFileReader create(Path path, Channel writeChannel, Integer pollIntervalInMs) throws IOException
path - writeChannel - pollIntervalInMs - Poll interval value or null in order to wait for notify on reference channelIOExceptionpublic boolean isAborted()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelIOExceptionCopyright © 2020. All rights reserved.