aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/pdf/StreamCache.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2003-01-11 19:38:52 +0000
committerKeiron Liddle <keiron@apache.org>2003-01-11 19:38:52 +0000
commit2c1fdfe32eee04d96bd4cc736e7bb164cf031efa (patch)
treee41729f0f604a3bae44492d633f233b538b4c525 /src/org/apache/fop/pdf/StreamCache.java
parent19c1ab18a9d22898f0893a0e1890b7e69f965ae1 (diff)
downloadxmlgraphics-fop-2c1fdfe32eee04d96bd4cc736e7bb164cf031efa.tar.gz
xmlgraphics-fop-2c1fdfe32eee04d96bd4cc736e7bb164cf031efa.zip
cleaned up some style errors
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195843 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/pdf/StreamCache.java')
-rw-r--r--src/org/apache/fop/pdf/StreamCache.java32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/org/apache/fop/pdf/StreamCache.java b/src/org/apache/fop/pdf/StreamCache.java
index f2d5b904a..21aa55a36 100644
--- a/src/org/apache/fop/pdf/StreamCache.java
+++ b/src/org/apache/fop/pdf/StreamCache.java
@@ -1,16 +1,14 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.pdf;
-import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.IOException;
-import java.util.ArrayList;
/**
* class used to store the bytes for a PDFStream. It's actually a generic
@@ -27,6 +25,8 @@ public abstract class StreamCache {
/**
* Change the global cacheToFile flag.
+ *
+ * @param tizit true if cache to file
*/
public static void setCacheToFile(boolean tizit) {
cacheToFile = tizit;
@@ -34,6 +34,8 @@ public abstract class StreamCache {
/**
* Get the value of the global cacheToFile flag.
+ *
+ * @return the current cache to file flag
*/
public static boolean getCacheToFile() {
return cacheToFile;
@@ -42,42 +44,62 @@ public abstract class StreamCache {
/**
* Get the correct implementation (based on cacheToFile) of
* StreamCache.
+ *
+ * @throws IOException if there is an IO error
+ * @return a new StreamCache for caching streams
*/
public static StreamCache createStreamCache() throws IOException {
- if (cacheToFile)
+ if (cacheToFile) {
return new TempFileStreamCache();
- else
+ } else {
return new InMemoryStreamCache();
+ }
}
/**
* Get the current OutputStream. Do not store it - it may change
* from call to call.
+ *
+ * @throws IOException if there is an IO error
+ * @return an output stream for this cache
*/
public abstract OutputStream getOutputStream() throws IOException;
/**
* Filter the cache with the supplied PDFFilter.
+ *
+ * @param filter the filter to apply
+ * @throws IOException if there is an IO error
*/
public abstract void applyFilter(PDFFilter filter) throws IOException;
/**
* Outputs the cached bytes to the given stream.
+ *
+ * @param stream the stream to write to
+ * @throws IOException if there is an IO error
*/
public abstract void outputStreamData(OutputStream stream) throws IOException;
/**
* Returns the current size of the stream.
+ *
+ * @throws IOException if there is an IO error
+ * @return the size of the cache
*/
public abstract int getSize() throws IOException;
/**
* Closes the cache and frees resources.
+ *
+ * @throws IOException if there is an IO error
*/
public abstract void close() throws IOException;
/**
* Clears and resets the cache.
+ *
+ * @throws IOException if there is an IO error
*/
public abstract void reset() throws IOException;
}