public class SftpInputStreamAsync extends InputStreamWithChannel implements SftpClientHolder
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
SftpInputStreamAsync.BufferConsumer |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bb |
protected Buffer |
buffer |
protected int |
bufferSize |
private AbstractSftpClient |
clientInstance |
protected long |
clientOffset |
protected boolean |
eofIndicator |
protected long |
fileSize |
protected SftpClient.CloseableHandle |
handle |
protected org.slf4j.Logger |
log |
private java.lang.String |
path |
protected java.util.Deque<SftpAckData> |
pendingReads |
protected long |
requestOffset |
Constructor and Description |
---|
SftpInputStreamAsync(AbstractSftpClient client,
int bufferSize,
long clientOffset,
long fileSize,
java.lang.String path,
SftpClient.CloseableHandle handle) |
SftpInputStreamAsync(AbstractSftpClient client,
int bufferSize,
java.lang.String path,
java.util.Collection<SftpClient.OpenMode> mode) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private long |
doRead(long max,
SftpInputStreamAsync.BufferConsumer consumer) |
protected void |
fillData() |
AbstractSftpClient |
getClient() |
java.lang.String |
getPath()
The remotely accessed file path
|
protected boolean |
hasNoData() |
boolean |
isEof()
Check if the stream is at EOF
|
boolean |
isOpen() |
protected void |
pollBuffer(SftpAckData ack) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
protected void |
sendRequests() |
long |
skip(long n) |
java.lang.String |
toString() |
long |
transferTo(long len,
java.nio.channels.WritableByteChannel out) |
long |
transferTo(java.io.OutputStream out) |
protected final org.slf4j.Logger log
protected final byte[] bb
protected final int bufferSize
protected final long fileSize
protected Buffer buffer
protected SftpClient.CloseableHandle handle
protected long requestOffset
protected long clientOffset
protected final java.util.Deque<SftpAckData> pendingReads
protected boolean eofIndicator
private final AbstractSftpClient clientInstance
private final java.lang.String path
public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode) throws java.io.IOException
java.io.IOException
public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, java.lang.String path, SftpClient.CloseableHandle handle)
public final AbstractSftpClient getClient()
getClient
in interface SftpClientHolder
public final java.lang.String getPath()
public boolean isEof()
true
if all the data has been consumerpublic boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long transferTo(long len, java.nio.channels.WritableByteChannel out) throws java.io.IOException
java.io.IOException
public long transferTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
private long doRead(long max, SftpInputStreamAsync.BufferConsumer consumer) throws java.io.IOException
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
protected boolean hasNoData()
protected void sendRequests() throws java.io.IOException
java.io.IOException
protected void fillData() throws java.io.IOException
java.io.IOException
protected void pollBuffer(SftpAckData ack) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
close
in class java.io.InputStream
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object