public final class SftpInputStream extends InputStream implements ConnectedTestable
Instances of this class are not safe for use by multiple threads.
| Constructor and Description |
|---|
SftpInputStream(SftpChannel channel,
String path)
Create a new SFTP input stream.
|
SftpInputStream(SftpChannel channel,
String path,
long skip)
Create a new SFTP input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
boolean |
isConnected()
Answer whether this object is currently connected.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
mark, markSupported, resetpublic SftpInputStream(SftpChannel channel, String path) throws NotConnectedException
channel - The SFTP channelpath - The file pathIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - in case of being not connectedpublic SftpInputStream(SftpChannel channel, String path, long skip) throws NotConnectedException
channel - The SFTP channelpath - The file pathskip - The number of bytes to skip before reading inputIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - in case of being not connectedpublic final boolean isConnected()
ConnectedTestableisConnected in interface ConnectedTestablepublic final int read()
read in class InputStreampublic final int read(byte[] b)
read in class InputStreampublic final int read(byte[] b,
int off,
int len)
read in class InputStreampublic final long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic final int available()
available in class InputStreampublic final void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamCopyright © 2019. All rights reserved.