|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.client.toolkit.activity.delivery.DataTransportBlockReader
A BlockReader implementation which fetches each block
from an output stream exposed by a data service resource exposed by
a data service using the service's get operations.
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private int |
mBlocksToFetch
The number of blocks to fetch from a service at once. |
private java.lang.Object |
mNextBlock
The block which will be returned the next time the next method is called. |
private DataTransport |
mService
Object that handles get operations on a service. |
| Constructor Summary | |
DataTransportBlockReader(DataTransport service)
|
|
DataTransportBlockReader(DataTransport service,
int blocksToFetch)
Default constructor. |
|
| Method Summary | |
java.lang.Object |
fetchBlock()
Obtain a block from the output stream exposed by a data service resource of the service or return null
if all the data has been read. |
boolean |
hasNext()
Indicates whether or not there are any more blocks of data to be read from the block reader. |
java.lang.Object |
next()
Gets the next block of data contained in the block reader. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.Object mNextBlock
next method is called. (We employ a one-block
buffer to enable hasNext() to work.)
private final int mBlocksToFetch
private final DataTransport mService
get operations on a service.
| Constructor Detail |
public DataTransportBlockReader(DataTransport service)
throws StreamDataException
public DataTransportBlockReader(DataTransport service,
int blocksToFetch)
throws StreamDataException
service - Object handling access to the service's output stream.blocksToFetch - The number of blocks to fetch from the service at
once. These are aggregated into a single block
service-side.
StreamDataException - If there is a problem when streaming the data from the
service.| Method Detail |
public boolean hasNext()
BlockReader
hasNext in interface BlockReaderpublic java.lang.Object next()
BlockReader
next in interface BlockReaderObject
public java.lang.Object fetchBlock()
throws StreamDataException
null
if all the data has been read.
StreamDataException - If there is a problem when streaming the data from the
service.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||