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
public class SftpInputStreamAsync
extends org.apache.sshd.common.util.io.input.InputStreamWithChannel
implements SftpClientHolder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected org.apache.sshd.common.util.buffer.Bufferprotected final intprotected longprotected booleanprotected final longprotected SftpClient.CloseableHandleprotected final org.slf4j.Loggerprotected 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 TypeMethodDescriptionvoidclose()protected voidfillData()final AbstractSftpClientfinal StringgetPath()The remotely accessed file pathprotected booleanbooleanisEof()Check if the stream is at EOFbooleanisOpen()protected voidpollBuffer(SftpAckData ack) intread()intread(byte[] b, int off, int len) protected voidlongskip(long n) toString()longtransferTo(long len, WritableByteChannel out) longtransferTo(OutputStream out) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes
-
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
protected org.apache.sshd.common.util.buffer.Buffer buffer -
handle
-
requestOffset
protected long requestOffset -
clientOffset
protected long clientOffset -
pendingReads
-
eofIndicator
protected boolean eofIndicator
-
-
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:
getClientin interfaceSftpClientHolder
-
getPath
The remotely accessed file path- Returns:
- Remote file path
-
isEof
public boolean isEof()Check if the stream is at EOF- Returns:
trueif all the data has been consumer
-
isOpen
public boolean isOpen() -
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
transferTo
- Throws:
IOException
-
transferTo
- Overrides:
transferToin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
hasNoData
protected boolean hasNoData() -
sendRequests
- Throws:
IOException
-
fillData
- Throws:
IOException
-
pollBuffer
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
toString
-