| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| protected final byte[] | |
| protected Buffer | |
| protected boolean | |
| protected int | |
| private final AbstractSftpClient | |
| protected long | |
| protected boolean | |
| protected final long | |
| protected SftpClient. | |
| protected final Logger | |
| protected int | |
| private static final int | |
| private final boolean | |
| private final String | |
| protected final Deque | |
| protected long | |
| protected long |
| Access | Constructor and Description |
|---|---|
| public | SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient.
|
| public | SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient.
|
| public | SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient.
|
| Modifier and Type | Method and Description |
|---|---|
| protected int | Returns: a new buffer size in the range [1..currentBufferSize].the current SFTP buffer size currentBufferSize, long the number of short reads so far nOfShortReads, int the maximum number of bytes the server returned in any previous read request maxBufferReceived, long the size of the gap just filled gap)Dynamically adjust the SFTP buffer size, if it is too large. |
| public void | close()
Overrides java. Implements java. Closes this channel. |
| private long | |
| protected boolean | |
| public final AbstractSftpClient | |
| public final String | |
| protected boolean | |
| public boolean | |
| public boolean | |
| protected void | |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| protected void | |
| public long | skip(long
the number of bytes to be skipped. n)Overrides java. Skips over and discards |
| public String | |
| public long | |
| public long | transferTo(OutputStream
the output stream, non-null out)Overrides java. Reads all bytes from this input stream and writes the bytes to the given output stream in the order that they are read. |
| bb | back to summary |
|---|---|
| protected final byte[] bb | |
| buffer | back to summary |
|---|---|
| protected Buffer buffer | |
| bufferAdjusted | back to summary |
|---|---|
| protected boolean bufferAdjusted | |
| bufferSize | back to summary |
|---|---|
| protected int bufferSize | |
| clientInstance | back to summary |
|---|---|
| private final AbstractSftpClient clientInstance | |
| clientOffset | back to summary |
|---|---|
| protected long clientOffset | |
| eofIndicator | back to summary |
|---|---|
| protected boolean eofIndicator | |
| fileSize | back to summary |
|---|---|
| protected final long fileSize | |
| handle | back to summary |
|---|---|
| protected SftpClient. | |
| log | back to summary |
|---|---|
| protected final Logger log | |
| maxReceived | back to summary |
|---|---|
| protected int maxReceived | |
| MIN_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MIN_BUFFER_SIZE | |
| ownsHandle | back to summary |
|---|---|
| private final boolean ownsHandle | |
| path | back to summary |
|---|---|
| private final String path | |
| pendingReads | back to summary |
|---|---|
| protected final Deque<SftpAckData> pendingReads | |
| requestOffset | back to summary |
|---|---|
| protected long requestOffset | |
| shortReads | back to summary |
|---|---|
| protected long shortReads | |
| SftpInputStreamAsync | back to summary |
|---|---|
| public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient. | |
| SftpInputStreamAsync | back to summary |
|---|---|
| public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient. | |
| SftpInputStreamAsync | back to summary |
|---|---|
| public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, long clientOffset, long fileSize, String path, SftpClient. | |
| adjustBufferIfNeeded | back to summary |
|---|---|
| protected int adjustBufferIfNeeded(int currentBufferSize, long nOfShortReads, int maxBufferReceived, long gap) Dynamically adjust the SFTP buffer size, if it is too large. Although it is possible to reduce the buffer size to a single byte, in practice some sane lower limit (like, 8kB) should be maintained.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this channel. After a channel is closed, any further attempt to invoke I/O
operations upon it will cause a If this channel is already closed then invoking this method has no effect. This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.
| |
| doRead | back to summary |
|---|---|
| private long doRead(long max, SftpInputStreamAsync. | |
| fillData | back to summary |
|---|---|
| protected boolean fillData() throws IOException | |
| getClient | back to summary |
|---|---|
| public final AbstractSftpClient getClient() Implements org.
| |
| getPath | back to summary |
|---|---|
| public final String getPath() The remotely accessed file path
| |
| hasNoData | back to summary |
|---|---|
| protected boolean hasNoData() | |
| isEof | back to summary |
|---|---|
| public boolean isEof() Check if the stream is at EOF
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from java. Tells whether or not this channel is open.
| |
| pollBuffer | back to summary |
|---|---|
| protected void pollBuffer(SftpAckData ack) throws IOException | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| sendRequests | back to summary |
|---|---|
| protected void sendRequests() throws IOException | |
| skip | back to summary |
|---|---|
| public long skip(long n) throws IOException Overrides java. Doc from java. Skips over and discards
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| transferTo | back to summary |
|---|---|
| public long transferTo(long len, WritableByteChannel out) throws IOException | |
| transferTo | back to summary |
|---|---|
| public long transferTo(OutputStream out) throws IOException Overrides java. Doc from java. Reads all bytes from this input stream and writes the bytes to the given output stream in the order that they are read. On return, this input stream will be at end of stream. This method does not close either stream. This method may block indefinitely reading from the input stream, or writing to the output stream. The behavior for the case where the input and/or output stream is asynchronously closed, or the thread interrupted during the transfer, is highly input and output stream specific, and therefore not specified.
If the total number of bytes transferred is greater than Long#MAX_VALUE, then If an I/O error occurs reading from the input stream or writing to the output stream, then it may do so after some bytes have been read or written. Consequently the input stream may not be at end of stream and one, or both, streams may be in an inconsistent state. It is strongly recommended that both streams be promptly closed if an I/O error occurs.
| |
| consume | back to summary |
|---|---|
| public void consume(Buffer buffer) throws IOException | |