Package org.apache.sshd.sftp.client.impl
Class SftpInputStreamAsync
java.lang.Object
java.io.InputStream
org.apache.sshd.common.util.io.input.InputStreamWithChannel
org.apache.sshd.sftp.client.impl.SftpInputStreamAsync
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,SftpClientHolder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]
protected Buffer
protected final int
private final AbstractSftpClient
protected long
protected boolean
protected final long
protected SftpClient.CloseableHandle
protected final org.slf4j.Logger
private final String
protected final Deque<SftpAckData>
protected long
-
Constructor Summary
ConstructorsConstructorDescriptionSftpInputStreamAsync
(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient.CloseableHandle handle) SftpInputStreamAsync
(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private long
doRead
(long max, SftpInputStreamAsync.BufferConsumer consumer) protected void
fillData()
final AbstractSftpClient
final String
getPath()
The remotely accessed file pathprotected boolean
boolean
isEof()
Check if the stream is at EOFboolean
isOpen()
protected void
pollBuffer
(SftpAckData ack) int
read()
int
read
(byte[] b, int off, int len) protected void
long
skip
(long n) toString()
long
transferTo
(long len, WritableByteChannel out) long
transferTo
(OutputStream out) Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset
-
Field Details
-
log
protected final org.slf4j.Logger log -
bb
protected final byte[] bb -
bufferSize
protected final int bufferSize -
fileSize
protected final long fileSize -
buffer
-
handle
-
requestOffset
protected long requestOffset -
clientOffset
protected long clientOffset -
pendingReads
-
eofIndicator
protected boolean eofIndicator -
clientInstance
-
path
-
-
Constructor Details
-
SftpInputStreamAsync
public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode) throws IOException - Throws:
IOException
-
SftpInputStreamAsync
public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient.CloseableHandle handle)
-
-
Method Details
-
getClient
- Specified by:
getClient
in interfaceSftpClientHolder
-
getPath
The remotely accessed file path- Returns:
- Remote file path
-
isEof
public boolean isEof()Check if the stream is at EOF- Returns:
true
if all the data has been consumer
-
isOpen
public boolean isOpen() -
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
transferTo
- Throws:
IOException
-
transferTo
- Throws:
IOException
-
doRead
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
hasNoData
protected boolean hasNoData() -
sendRequests
- Throws:
IOException
-
fillData
- Throws:
IOException
-
pollBuffer
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
toString
-