diff options
author | Keiron Liddle <keiron@apache.org> | 2002-03-08 15:42:33 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-03-08 15:42:33 +0000 |
commit | 300e94550892476a45d60cb0da80a0fe595a9a80 (patch) | |
tree | be84437848c8b05c242c0e8cdcf327df4d1d349c /src/org/apache | |
parent | a75284eec3938887e379cb31b4c08b606820c1d5 (diff) | |
download | xmlgraphics-fop-300e94550892476a45d60cb0da80a0fe595a9a80.tar.gz xmlgraphics-fop-300e94550892476a45d60cb0da80a0fe595a9a80.zip |
no longer needed
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194698 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r-- | src/org/apache/fop/system/BufferArray.java | 28 | ||||
-rw-r--r-- | src/org/apache/fop/system/BufferFile.java | 25 | ||||
-rw-r--r-- | src/org/apache/fop/system/BufferManager.java | 189 |
3 files changed, 0 insertions, 242 deletions
diff --git a/src/org/apache/fop/system/BufferArray.java b/src/org/apache/fop/system/BufferArray.java deleted file mode 100644 index a5596dc46..000000000 --- a/src/org/apache/fop/system/BufferArray.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -// Seshadri -/* This package is to be used for all Oeprating System related activities. */ -/* This buffers data into an array in memory */ - -package org.apache.fop.system; - - -// FOP - - - -// Java - - -public class BufferArray { - - - public BufferArray() {} - -} - diff --git a/src/org/apache/fop/system/BufferFile.java b/src/org/apache/fop/system/BufferFile.java deleted file mode 100644 index 370496f4b..000000000 --- a/src/org/apache/fop/system/BufferFile.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -// Seshadri -/* This package is to be used for all Oeprating System related activities. */ -/* This buffers data into a file */ - - - -package org.apache.fop.system; - - -import java.io.*; - - - -public class BufferFile { - - public BufferFile() {} - -} diff --git a/src/org/apache/fop/system/BufferManager.java b/src/org/apache/fop/system/BufferManager.java deleted file mode 100644 index 2e8b8c4fc..000000000 --- a/src/org/apache/fop/system/BufferManager.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -// Seshadri -/* - * This package is to be used for all Oeprating System related activities. - * This file manages system buffers - */ - -package org.apache.fop.system; - - -// FOP - -import org.apache.fop.fo.FONode; - - -// Java - -import java.io.*; -import java.util.Hashtable; - - -public class BufferManager { - - - protected FileWriter fw; - protected FileReader fr; - protected char cache[]; // Cache - protected long csize; // Cache size - - - protected File buff = null; - - protected long fp = 0; - - protected long markStart = - 0; // used to set the current point in the stream while reading - protected long markEnd = 0; - protected long curMark = 0; - - // Hash of objects and their offsets within - - Hashtable offSetTable = new Hashtable(); - - private class Offset { - - long fp = 0; // File Pointer - int length; - char[] data; // when no buffer is specified - - Offset(long fp, int length, char data[]) { - this.fp = fp; - this.length = length; - this.data = data; - } - - } - - - - public void addBufferFile(File buff) { - - if (buff != null) - try { - fw = new FileWriter(buff); - fr = new FileReader(buff); - csize = 100000; - this.buff = buff; - } catch (Exception e) { - System.out.println(e); - } - - } - - public void writeBuffer(Object obj, char arr[]) { - - int length = arr.length; - - if (buff != null) { - offSetTable.put(obj, new Offset(this.fp, length, null)); - try { - fw.write(arr); - - this.fp += length; - } catch (Exception e) { - System.out.println(e); - } - } else { - // Store the data in memory - offSetTable.put(obj, new Offset(this.fp, length, arr)); - } - - - } - - - public void readComplete() { - - // An indication that manager can close the writable buffers and prepare - // for reading.. - if (buff != null) - try { - - fw.close(); - - cache = new char[(int)csize]; - setupCache(curMark); - - } catch (Exception e) { - System.out.println(e); - } - } - - - - - public char[] readBuffer(Object obj) { - - Offset values = (Offset)offSetTable.get(obj); - - // Was buffering used? - - if (buff != null) { - - - char ca[] = new char[values.length]; - - // Check if csize is too small - - if (csize < values.length) { - System.out.println("Cache size too small"); - } - - - // Is the data outside the cache? - - if (!(values.fp >= markStart - && values.fp + values.length <= markEnd)) { - - setupCache(values.fp); - } - - - for (long i = values.fp - markStart, j = 0; j < values.length; - ++i, ++j) { - - ca[(int)j] = cache[(int)i]; - } - - - return ca; - } else { - return values.data; - } - } - - protected void setupCache(long curMark) { - - try { - - FileReader fr = new FileReader(buff); - fr.skip(curMark); - - long rem = buff.length() - curMark; - if (rem > csize) { - - rem = csize; - } - - fr.read(cache, 0, (int)rem); - - - markStart = curMark; - markEnd = rem - 1; - - } catch (Exception e) { - System.out.println(e); - } - - - } - - -} |