Package org.globus.ftp
Class OutputStreamDataSource
- java.lang.Object
-
- org.globus.ftp.OutputStreamDataSource
-
- All Implemented Interfaces:
DataSource
public class OutputStreamDataSource extends java.lang.Object implements DataSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
OutputStreamDataSource.DataOutputStream
-
Field Summary
Fields Modifier and Type Field Description protected CircularBuffer
buffers
private OutputStreamDataSource.DataOutputStream
out
-
Constructor Summary
Constructors Constructor Description OutputStreamDataSource(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this data source and releases any system resources associated with this source.java.io.OutputStream
getOutputStream()
Buffer
read()
Reads a data buffer from this data source.long
totalSize()
Optional operation.
-
-
-
Field Detail
-
buffers
protected CircularBuffer buffers
-
out
private OutputStreamDataSource.DataOutputStream out
-
-
Method Detail
-
read
public Buffer read() throws java.io.IOException
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:
java.io.IOException
- if an I/O error occurs.
-
close
public void close() throws java.io.IOException
Description copied from interface:DataSource
Closes this data source and releases any system resources associated with this source.- Specified by:
close
in interfaceDataSource
- Throws:
java.io.IOException
- if an I/O error occurs.
-
getOutputStream
public java.io.OutputStream getOutputStream()
-
totalSize
public long totalSize() throws java.io.IOException
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
- Throws:
java.io.IOException
- if an I/O exception occurs
-
-