org.objectweb.proactive.core.filetransfer.FileBlock Class Reference

This class represents a fraction of a file. More...

List of all members.

Public Member Functions

 FileBlock ()
 Empty ProActive constructor.
 FileBlock (long offset)
 FileBlock (long offset, int blockSize)
void loadNextBlock (BufferedInputStream bis) throws IOException
 Loads the FileBlock object with a block from the source file this block references.
void saveCurrentBlock (BufferedOutputStream bos) throws IOException
 Saves the current block into an output stream buffer.
long getOffset ()
 
Returns:
Returns the offset.

int getBlockSize ()
 
Returns:
Returns the blockSize.

Exception getException ()
boolean hasException ()
void setException (Exception e)

Static Public Attributes

static final int DEFAULT_BLOCK_SIZE = 256 * 1024

Static Protected Attributes

static Logger logger = ProActiveLogger.getLogger(Loggers.FILETRANSFER)


Detailed Description

This class represents a fraction of a file.

It is used to load file blocks from a file, to send them through the network, and later to store the file block on the remote machines.

Author:
ProActive Team 09/2005 (mleyton)

Definition at line 78 of file FileBlock.java.


Member Function Documentation

void org.objectweb.proactive.core.filetransfer.FileBlock.loadNextBlock ( BufferedInputStream  bis  )  throws IOException

Loads the FileBlock object with a block from the source file this block references.

If the parameter is null, then it will create a new buffer from the parameters stored in the block instance. Note that creating a new block requires performing a skip (seek) on the stream, which is very slow. Therefore it is better to pass the buffered stream as parameter.

Definition at line 112 of file FileBlock.java.

Referenced by org.objectweb.proactive.core.filetransfer.FileTransferService.getFileBlock(), and org.objectweb.proactive.core.filetransfer.FileTransferService.sendFile().

void org.objectweb.proactive.core.filetransfer.FileBlock.saveCurrentBlock ( BufferedOutputStream  bos  )  throws IOException

Saves the current block into an output stream buffer.

Parameters:
bos The BufferedOutputStream to save the file
Exceptions:
IOException If an error is encountered.

Definition at line 133 of file FileBlock.java.

Referenced by org.objectweb.proactive.core.filetransfer.FileTransferService.saveFileBlockAndForwardWithoutThrowingException(), and org.objectweb.proactive.core.filetransfer.FileTransferService.saveFileBlockWithoutThrowingException().


The documentation for this class was generated from the following file:
Generated on Mon Jan 22 15:16:26 2007 for ProActive by  doxygen 1.5.1