uk.org.ogsadai.common
Interface BlockBuffer

All Known Implementing Classes:
SimpleBlockBuffer

public interface BlockBuffer

An interface for buffering sequences of blocks and then retrieving the sequence as a single aggregate block.

Author:
The OGSA-DAI Project Team

Method Summary
 void appendBlock(java.lang.Object block)
          Appends the specified block to the buffer.
 int size()
          Returns a count of the number of blocks that have been appended to the buffer.
 java.lang.Object toBlock()
          Returns a single block containing all the data appended to the buffer.
 

Method Detail

appendBlock

public void appendBlock(java.lang.Object block)
                 throws OutOfMemoryException
Appends the specified block to the buffer.

Parameters:
block - The block to append.
Throws:
OutOfMemoryException - if there is not enough memory to retrieve the block.

toBlock

public java.lang.Object toBlock()
                         throws OutOfMemoryException
Returns a single block containing all the data appended to the buffer. If not data has been appended then null is returned.

Returns:
the data.
Throws:
OutOfMemoryException - if there is not enough memory to retrieve the block.

size

public int size()
Returns a count of the number of blocks that have been appended to the buffer.

Returns:
the count.