Package org.globus.ftp

# Class DataSinkStream

java.lang.Object
org.globus.ftp.DataSinkStream

All Implemented Interfaces:
  `DataSink`

public class DataSinkStream extends Object implements DataSink
Reference implementation of DataSink. It can be used with non-parallel transfers. It cannot be used with Extended Block Mode because it uses implicit assumption that data arrives in correct sequence. It is not thread safe.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`autoFlush`
`protected boolean`
`ignoreOffset`
`protected long`
`offset`
`protected OutputStream`
`out`

## Constructor Summary

Constructors
Constructor
Description
`DataSinkStream(OutputStream out)`
`DataSinkStream(OutputStream out, boolean autoFlush, boolean ignoreOffset)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Closes this data sink and releases any system resources associated with this sink.
`void`
`write(Buffer buffer)`
Writes the specified buffer to this data sink.

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

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

## Field Details

### out

protected OutputStream out

### autoFlush

protected boolean autoFlush

### ignoreOffset

protected boolean ignoreOffset

### offset

protected long offset

## Constructor Details

### DataSinkStream

public DataSinkStream(OutputStream out)

### DataSinkStream

public DataSinkStream(OutputStream out, boolean autoFlush, boolean ignoreOffset)

## Method Details

### write

public void write(Buffer buffer) throws IOException
Description copied from interface: `DataSink`
Writes the specified buffer to this data sink.
Note: `buffer.getOffset()` might return -1 if the transfer mode used does not support data offsets, for example stream transfer mode.

Specified by:
  `write` in interface `DataSink`
Parameters:
  `buffer` - the data buffer to write.
Throws:
  `IOException` - if an I/O error occurs.

### close

public void close() throws IOException
Description copied from interface: `DataSink`
Closes this data sink and releases any system resources associated with this sink.

Specified by:
  `close` in interface `DataSink`
Throws:
  `IOException` - if an I/O error occurs.