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:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel
public class SftpInputStreamWithChannel extends InputStreamWithChannel
Implements an input stream for reading from a remote file
-
-
Field Summary
Fields Modifier and Type Field Description private intavailableprivate byte[]bbprivate byte[]bufferprivate SftpClientclientprivate SftpClient.CloseableHandlehandleprivate intindexprivate longoffsetprivate java.lang.Stringpath
-
Constructor Summary
Constructors Constructor Description SftpInputStreamWithChannel(SftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()SftpClientgetClient()The client instancejava.lang.StringgetPath()The remotely accessed file pathbooleanisOpen()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b, int off, int len)voidreset()longskip(long n)
-
-
-
Field Detail
-
client
private final SftpClient client
-
path
private final java.lang.String path
-
bb
private byte[] bb
-
buffer
private byte[] buffer
-
index
private int index
-
available
private int available
-
handle
private SftpClient.CloseableHandle handle
-
offset
private long offset
-
-
Constructor Detail
-
SftpInputStreamWithChannel
public SftpInputStreamWithChannel(SftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getClient
public final SftpClient getClient()
The client instance- Returns:
SftpClientinstance used to access the remote file
-
getPath
public final java.lang.String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
isOpen
public boolean isOpen()
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
-