Package org.globus.ftp
Interface DataSource
- All Known Implementing Classes:
DataSourceStream
,FileRandomIO
,OutputStreamDataSource
public interface DataSource
Data channel uses this interface to read outgoing data.
Implement it to provide your own ways of reading data.
It must be thread safe; in parallel transfer mode several
streams may attempt to read.
-
Method Summary
-
Method Details
-
read
Reads a data buffer from this data source.- Returns:
- The data buffer read. Null, if there is no more data to be read.
- Throws:
IOException
- if an I/O error occurs.
-
close
Closes this data source and releases any system resources associated with this source.- Throws:
IOException
- if an I/O error occurs.
-
totalSize
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- Throws:
IOException
- if an I/O exception occurs
-