org.globus.io.streams
public class HTTPOutputStream extends GlobusOutputStream
Modifier and Type | Field and Description |
---|---|
protected boolean |
append |
protected java.io.InputStream |
in |
protected java.io.OutputStream |
output |
protected long |
size |
protected java.net.Socket |
socket |
Modifier | Constructor and Description |
---|---|
protected |
HTTPOutputStream()
Private constructor used by subclasses.
|
|
HTTPOutputStream(java.lang.String host,
int port,
java.lang.String file,
long length,
boolean append)
Opens HTTP output stream (unsecure)
|
protected java.io.OutputStream output
protected java.io.InputStream in
protected java.net.Socket socket
protected long size
protected boolean append
protected HTTPOutputStream()
public HTTPOutputStream(java.lang.String host, int port, java.lang.String file, long length, boolean append) throws GassException, java.io.IOException
host
- host name of the HTTP server.port
- port number of the HTTP server.file
- name of the file on the remote side.length
- total size of the data to be transfered.
Use -1 if unknown. The data then will be
transfered in chunks.append
- if true, append data to existing file.
Otherwise, the file will be overwritten.GassException
java.io.IOException
protected void put(java.lang.String host, java.lang.String file, long length, int waittime) throws java.io.IOException
java.io.IOException
public void abort()
GlobusOutputStream
abort
in class GlobusOutputStream
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public void write(byte[] msg) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] msg, int from, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class GlobusOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException