org.apache.fop.pdf

Class StreamCacheFactory


public class StreamCacheFactory
extends java.lang.Object

This class is serves as a factory from

Constructor Summary

StreamCacheFactory(boolean cacheToFile)
Creates a new StreamCacheFactory.

Method Summary

StreamCache
createStreamCache()
Get the correct implementation (based on cacheToFile) of StreamCache.
StreamCache
createStreamCache(int hintSize)
Get the correct implementation (based on cacheToFile) of StreamCache.
boolean
getCacheToFile()
Get the value of the global cacheToFile flag.
static StreamCacheFactory
getInstance()
Returns an instance of a StreamCacheFactory depending on the default setting for cacheToFile.
static StreamCacheFactory
getInstance(boolean cacheToFile)
Returns an instance of a StreamCacheFactory with the requested features.
static void
setDefaultCacheToFile(boolean cacheToFile)
Sets the global default for cacheToFile

Constructor Details

StreamCacheFactory

public StreamCacheFactory(boolean cacheToFile)
Creates a new StreamCacheFactory.
Parameters:
cacheToFile - True if file shall be cached using a temporary file

Method Details

createStreamCache

public StreamCache createStreamCache()
            throws IOException
Get the correct implementation (based on cacheToFile) of StreamCache.
Returns:
a new StreamCache for caching streams

createStreamCache

public StreamCache createStreamCache(int hintSize)
            throws IOException
Get the correct implementation (based on cacheToFile) of StreamCache.
Parameters:
hintSize - a hint about the approximate expected size of the buffer
Returns:
a new StreamCache for caching streams

getCacheToFile

public boolean getCacheToFile()
Get the value of the global cacheToFile flag.
Returns:
the current cache to file flag

getInstance

public static StreamCacheFactory getInstance()
Returns an instance of a StreamCacheFactory depending on the default setting for cacheToFile.
Returns:
StreamCacheFactory the requested factory

getInstance

public static StreamCacheFactory getInstance(boolean cacheToFile)
Returns an instance of a StreamCacheFactory with the requested features.
Parameters:
cacheToFile - True if file shall be cached using a temporary file
Returns:
StreamCacheFactory the requested factory

setDefaultCacheToFile

public static void setDefaultCacheToFile(boolean cacheToFile)
Sets the global default for cacheToFile
Parameters:
cacheToFile - True if stream caches should be held in files.

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.