org.globus.ftp
Class DataSourceStream
java.lang.Object
org.globus.ftp.DataSourceStream
- All Implemented Interfaces:
- DataSource
- public class DataSourceStream
- extends Object
- implements DataSource
Reference implementation of DataSource. It can be used with non-parallel transfers.
It cannot be used with Extended Block Mode because it is not thread safe.
|
Method Summary |
void |
close()
Closes this data source and releases any system
resources associated with this source. |
Buffer |
read()
Reads a data buffer from this data source. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected InputStream in
bufferSize
protected int bufferSize
DataSourceStream
public DataSourceStream(InputStream in)
DataSourceStream
public DataSourceStream(InputStream in,
int bufferSize)
read
public Buffer read()
throws IOException
- Description copied from interface:
DataSource
- Reads a data buffer from this data source.
- Specified by:
read in interface DataSource
- Returns:
- The data buffer read. Null, if there is
no more data to be read.
- Throws:
IOException - if an I/O error occurs.
close
public void close()
throws IOException
- Description copied from interface:
DataSource
- Closes this data source and releases any system
resources associated with this source.
- Specified by:
close in interface DataSource
- Throws:
IOException - if an I/O error occurs.