Class SftpInputStreamWithChannel
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.sshd.common.util.io.InputStreamWithChannel
-
- org.apache.sshd.client.subsystem.sftp.SftpInputStreamWithChannel
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
public class SftpInputStreamWithChannel extends InputStreamWithChannel
Implements an input stream for reading from a remote file- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description SftpInputStreamWithChannel(SftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
SftpClient
getClient()
The client instanceString
getPath()
The remotely accessed file pathboolean
isOpen()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.InputStream
available, nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
SftpInputStreamWithChannel
public SftpInputStreamWithChannel(SftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getClient
public final SftpClient getClient()
The client instance- Returns:
SftpClient
instance used to access the remote file
-
getPath
public final String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
isOpen
public boolean isOpen()
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
-