public class FTPOutputStream extends FileTransferOutputStream
closed, remoteFile, size
Constructor and Description |
---|
FTPOutputStream(FTPClient client,
java.lang.String remoteFile)
Constructor.
|
FTPOutputStream(FTPClient client,
java.lang.String remoteFile,
boolean append)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources associated
with the stream.
|
void |
setMonitor(FTPProgressMonitorEx monitor,
long monitorInterval)
The output stream uses the progress monitor currently owned by the FTP client.
|
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Writes
b.length bytes from the specified byte array
to this output stream. |
getBytesTransferred, getRemoteFile
public FTPOutputStream(FTPClient client, java.lang.String remoteFile) throws java.io.IOException, FTPException
client
- connected FTPClient instance (or subclass)remoteFile
- name of remote file (if null, the server may
be able to generate a namejava.io.IOException
FTPException
public FTPOutputStream(FTPClient client, java.lang.String remoteFile, boolean append) throws java.io.IOException, FTPException
client
- connected FTPClient instance (or subclass)remoteFile
- name of remote file (if null, the server may
be able to generate a nameappend
- true if appending on the serverjava.io.IOException
FTPException
public void setMonitor(FTPProgressMonitorEx monitor, long monitorInterval)
monitor
- progress monitor referencemonitorInterval
- public void write(int b) throws java.io.IOException
b.length
bytes from the specified byte array
to this output stream.write
in class java.io.OutputStream
b
- the data.java.io.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
- if an I/O error occurs.Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.