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
 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.
 long totalSize()
          Optional operation.
 

Method Detail

read

Buffer read()
            throws java.io.IOException
Reads a data buffer from this data source.

Returns:
The data buffer read. Null, if there is no more data to be read.
Throws:
java.io.IOException - if an I/O error occurs.

close

void close()
           throws java.io.IOException
Closes this data source and releases any system resources associated with this source.

Throws:
java.io.IOException - if an I/O error occurs.

totalSize

long totalSize()
               throws java.io.IOException
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:
java.io.IOException - if an I/O exception occurs


Copyright © 2013. All Rights Reserved.