Package org.apache.fop.pdf
Class TempFileStreamCache
java.lang.Object
org.apache.fop.pdf.TempFileStreamCache
- All Implemented Interfaces:
StreamCache
StreamCache implementation that uses temporary files rather than heap.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TempFileStreamCache
Creates a new TempFileStreamCache.- Throws:
IOException
- if there is an IO error
-
-
Method Details
-
getOutputStream
Get the current OutputStream. Do not store it - it may change from call to call.- Specified by:
getOutputStream
in interfaceStreamCache
- Returns:
- the output stream for this cache
- Throws:
IOException
- if there is an IO error
-
write
Convenience method for writing data to the stream cache.- Specified by:
write
in interfaceStreamCache
- Parameters:
data
- byte array to write- Throws:
IOException
- if there is an IO error
-
outputContents
Outputs the cached bytes to the given stream.- Specified by:
outputContents
in interfaceStreamCache
- Parameters:
out
- the output stream to write to- Returns:
- the number of bytes written
- Throws:
IOException
- if there is an IO error
-
getSize
Returns the current size of the stream.- Specified by:
getSize
in interfaceStreamCache
- Returns:
- the size of the cache
- Throws:
IOException
- if there is an IO error
-
clear
Clears and resets the cache.- Specified by:
clear
in interfaceStreamCache
- Throws:
IOException
- if there is an IO error
-