public class InterruptingReadableByteChannel extends Object implements ReadableByteChannel, SeekableDecorator
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buffer |
protected long |
bytesRead |
protected InputStream |
in |
protected boolean |
interrupted |
protected long |
interruptPos |
protected Consumer<InterruptingReadableByteChannel> |
interruptPosFoundCallback |
protected org.apache.hadoop.fs.Seekable |
seekable |
| Constructor and Description |
|---|
InterruptingReadableByteChannel(InputStream in,
org.apache.hadoop.fs.Seekable seekable,
long interruptPos) |
InterruptingReadableByteChannel(InputStream in,
org.apache.hadoop.fs.Seekable seekable,
long interruptPos,
Consumer<InterruptingReadableByteChannel> interruptPosFoundCallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getBytesRead() |
org.apache.hadoop.fs.Seekable |
getSeekable() |
boolean |
isOpen() |
int |
read(ByteBuffer byteBuffer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPos, seek, seekToNewSourceprotected byte[] buffer
protected boolean interrupted
protected InputStream in
protected org.apache.hadoop.fs.Seekable seekable
protected long interruptPos
protected long bytesRead
protected Consumer<InterruptingReadableByteChannel> interruptPosFoundCallback
public InterruptingReadableByteChannel(InputStream in, org.apache.hadoop.fs.Seekable seekable, long interruptPos)
public InterruptingReadableByteChannel(InputStream in, org.apache.hadoop.fs.Seekable seekable, long interruptPos, Consumer<InterruptingReadableByteChannel> interruptPosFoundCallback)
public int read(ByteBuffer byteBuffer) throws IOException
read in interface ReadableByteChannelIOExceptionpublic long getBytesRead()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic org.apache.hadoop.fs.Seekable getSeekable()
getSeekable in interface SeekableDecoratorCopyright © 2016–2021 Smart Data Analytics (SDA) Research Group. All rights reserved.