Package org.globus.ftp
Class DataSourceStream
java.lang.Object
org.globus.ftp.DataSourceStream
- All Implemented Interfaces:
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
private static final int
protected InputStream
protected long
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- See Also:
-
in
-
bufferSize
protected int bufferSize -
totalRead
protected long totalRead
-
-
Constructor Details
-
DataSourceStream
-
DataSourceStream
-
-
Method Details
-
read
Description copied from interface:DataSource
Reads a data buffer from this data source.- Specified by:
read
in interfaceDataSource
- Returns:
- The data buffer read. Null, if there is no more data to be read.
- Throws:
IOException
- if an I/O error occurs.
-
close
Description copied from interface:DataSource
Closes this data source and releases any system resources associated with this source.- Specified by:
close
in interfaceDataSource
- Throws:
IOException
- if an I/O error occurs.
-
totalSize
public long totalSize()Description copied from interface:DataSource
Optional operation. Returns the total size, in bytes, of the data in this source. If the implementation is not able to provide a total size for the data source, it should return -1- Specified by:
totalSize
in interfaceDataSource
-