| java.lang.Object org.apache.synapse.util.TemporaryData
TemporaryData | public class TemporaryData (Code) | | Class representing some temporary data in the form of a byte stream.
Data is stored by writing to the output stream obtained using
TemporaryData.getOutputStream() . It can then be read back using
the input stream obtained from
TemporaryData.getInputStream() .
The data is first stored into a fixed size buffer. Once this
buffer overflows, it is transferred to a temporary file. The buffer
is divided into a given number of fixed size chunks that are allocated
on demand. Since a temporary file may be created it is mandatory to
call
TemporaryData.release() to discard the temporary data.
|
Field Summary | |
int | chunkIndex Index of the chunk the next byte will be written to. | int | chunkOffset Offset into the chunk where the next byte will be written. | final int | chunkSize Size of the chunks that will be allocated in the buffer. | byte[][] | chunks Array of byte[] representing the chunks of the buffer. | final String | tempPrefix The prefix to be used in generating the name of the temporary file. | final String | tempSuffix The suffix to be used in generating the name of the temporary file. | File | temporaryFile The handle of the temporary file. |
chunkIndex | int chunkIndex(Code) | | Index of the chunk the next byte will be written to.
|
chunkOffset | int chunkOffset(Code) | | Offset into the chunk where the next byte will be written.
|
chunkSize | final int chunkSize(Code) | | Size of the chunks that will be allocated in the buffer.
|
chunks | byte[][] chunks(Code) | | Array of byte[] representing the chunks of the buffer.
A chunk is only allocated when the first byte is written to it.
This attribute is set to null when the buffer overflows and
is written out to a temporary file.
|
tempPrefix | final String tempPrefix(Code) | | The prefix to be used in generating the name of the temporary file.
|
tempSuffix | final String tempSuffix(Code) | | The suffix to be used in generating the name of the temporary file.
|
temporaryFile | File temporaryFile(Code) | | The handle of the temporary file. This is only set when the memory buffer
overflows and is written out to a temporary file.
|
TemporaryData | public TemporaryData(int numberOfChunks, int chunkSize, String tempPrefix, String tempSuffix)(Code) | | |
release | public void release()(Code) | | |
|
|