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, wait
getPos, seek, seekToNewSource
protected 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 ReadableByteChannel
IOException
public long getBytesRead()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
public org.apache.hadoop.fs.Seekable getSeekable()
getSeekable
in interface SeekableDecorator
Copyright © 2016–2021 Smart Data Analytics (SDA) Research Group. All rights reserved.