Package org.globus.io.streams

# Class HTTPOutputStream

java.lang.Object
java.io.OutputStream
org.globus.io.streams.GlobusOutputStream
org.globus.io.streams.HTTPOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

Direct Known Subclasses:
  `GassOutputStream`

public class HTTPOutputStream extends GlobusOutputStream

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`append`
`protected InputStream`
`in`
`protected OutputStream`
`output`
`protected long`
`size`
`protected Socket`
`socket`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`HTTPOutputStream()`
Private constructor used by subclasses.
``
`HTTPOutputStream(String host, int port, String file, long length, boolean append)`
Opens HTTP output stream (unsecure)

## Method Summary

Modifier and Type
Method
Description
`void`
`abort()`
Aborts transfer.
`void`
`close()`
`void`
`flush()`
`protected void`
`put(String host, String file, long length, int waittime)`
`void`
`write(byte[] msg)`
`void`
`write(byte[] msg, int from, int length)`
`void`
`write(int b)`

### Methods inherited from class java.io.OutputStream

`nullOutputStream`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### output

protected OutputStream output

### in

protected InputStream in

### socket

protected Socket socket

### size

protected long size

### append

protected boolean append

## Constructor Details

### HTTPOutputStream

protected HTTPOutputStream()
Private constructor used by subclasses.

### HTTPOutputStream

public HTTPOutputStream(String host, int port, String file, long length, boolean append) throws GassException, IOException
Opens HTTP output stream (unsecure)

Parameters:
  `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.
Throws:
  `GassException`
  `IOException`

## Method Details

### put

protected void put(String host, String file, long length, int waittime) throws IOException

Throws:
  `IOException`

### abort

public void abort()
Description copied from class: `GlobusOutputStream`
Aborts transfer. Usually makes sure to release all resources (sockets, file descriptors)
Does nothing by default.

Overrides:
  `abort` in class `GlobusOutputStream`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `OutputStream`
Throws:
  `IOException`

### write

public void write(byte[] msg) throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

### write

public void write(byte[] msg, int from, int length) throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

### write

public void write(int b) throws IOException

Overrides:
  `write` in class `GlobusOutputStream`
Throws:
  `IOException`

### flush

public void flush() throws IOException

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`
Throws:
  `IOException`