org.apache.fop.pdf
Class TempFileStreamCache
java.lang.Object
|
+--org.apache.fop.pdf.TempFileStreamCache
- All Implemented Interfaces:
- StreamCache
- public class TempFileStreamCache
- extends java.lang.Object
- implements StreamCache
StreamCache implementation that uses temporary files rather than heap.
Method Summary |
void |
clear()
Clears and resets the cache. |
java.io.OutputStream |
getOutputStream()
Get the current OutputStream. |
int |
getSize()
Returns the current size of the stream. |
int |
outputContents(java.io.OutputStream out)
Outputs the cached bytes to the given stream. |
void |
write(byte[] data)
Convenience method for writing data to the stream cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TempFileStreamCache
public TempFileStreamCache()
throws java.io.IOException
- Creates a new TempFileStreamCache.
- Throws:
java.io.IOException
- if there is an IO error
getOutputStream
public java.io.OutputStream getOutputStream()
throws java.io.IOException
- Get the current OutputStream. Do not store it - it may change
from call to call.
- Specified by:
getOutputStream
in interface StreamCache
- Returns:
- the output stream for this cache
- Throws:
java.io.IOException
- if there is an IO error
write
public void write(byte[] data)
throws java.io.IOException
- Description copied from interface:
StreamCache
- Convenience method for writing data to the stream cache.
- Specified by:
write
in interface StreamCache
- See Also:
StreamCache.write(byte[])
outputContents
public int outputContents(java.io.OutputStream out)
throws java.io.IOException
- Outputs the cached bytes to the given stream.
- Specified by:
outputContents
in interface StreamCache
- Parameters:
out
- the output stream to write to- Returns:
- the number of bytes written
- Throws:
java.io.IOException
- if there is an IO error
getSize
public int getSize()
throws java.io.IOException
- Returns the current size of the stream.
- Specified by:
getSize
in interface StreamCache
- Returns:
- the size of the cache
- Throws:
java.io.IOException
- if there is an IO error
clear
public void clear()
throws java.io.IOException
- Clears and resets the cache.
- Specified by:
clear
in interface StreamCache
- Throws:
java.io.IOException
- if there is an IO error
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.