Package org.apache.sshd.sftp.client.impl
Class SftpOutputStreamAsync
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.sshd.common.util.io.OutputStreamWithChannel
-
- org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,Channel
,SftpClientHolder
public class SftpOutputStreamAsync extends OutputStreamWithChannel implements SftpClientHolder
Implements an output stream for a given remote file- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
bb
protected Buffer
buffer
protected int
bufferSize
protected SftpClient.CloseableHandle
handle
protected org.slf4j.Logger
log
protected long
offset
protected Deque<SftpAckData>
pendingWrites
-
Constructor Summary
Constructors Constructor Description SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode)
SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, String path, SftpClient.CloseableHandle handle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
AbstractSftpClient
getClient()
String
getPath()
The remotely accessed file pathboolean
isOpen()
void
setOffset(long offset)
String
toString()
void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
bb
protected final byte[] bb
-
bufferSize
protected final int bufferSize
-
buffer
protected Buffer buffer
-
handle
protected SftpClient.CloseableHandle handle
-
offset
protected long offset
-
pendingWrites
protected final Deque<SftpAckData> pendingWrites
-
-
Constructor Detail
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, String path, Collection<SftpClient.OpenMode> mode) throws IOException
- Throws:
IOException
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, String path, SftpClient.CloseableHandle handle) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getClient
public final AbstractSftpClient getClient()
- Specified by:
getClient
in interfaceSftpClientHolder
-
setOffset
public void setOffset(long offset)
-
getPath
public final String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- 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 classOutputStream
- Throws:
IOException
-
-