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:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,java.nio.channels.Channel
public class SftpOutputStreamAsync extends OutputStreamWithChannel
Implements an output stream for a given remote file
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
bb
protected Buffer
buffer
protected int
bufferSize
private AbstractSftpClient
clientInstance
protected SftpClient.CloseableHandle
handle
protected org.slf4j.Logger
log
protected long
offset
private java.lang.String
path
protected java.util.Deque<SftpAckData>
pendingWrites
-
Constructor Summary
Constructors Constructor Description SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode)
SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, SftpClient.CloseableHandle handle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
AbstractSftpClient
getClient()
The client instancejava.lang.String
getPath()
The remotely accessed file pathboolean
isOpen()
void
setOffset(long offset)
java.lang.String
toString()
void
write(byte[] b, int off, int len)
void
write(int b)
-
-
-
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 java.util.Deque<SftpAckData> pendingWrites
-
clientInstance
private final AbstractSftpClient clientInstance
-
path
private final java.lang.String path
-
-
Constructor Detail
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode) throws java.io.IOException
- Throws:
java.io.IOException
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, SftpClient.CloseableHandle handle) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getClient
public final AbstractSftpClient getClient()
The client instance- Returns:
SftpClient
instance used to access the remote file
-
setOffset
public void setOffset(long offset)
-
getPath
public final java.lang.String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
isOpen
public boolean isOpen()
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.nio.channels.Channel
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-