From 8c56d5ecd022f351219101a383f95c0fe040cbb4 Mon Sep 17 00:00:00 2001 From: Said Ryan Ackley Date: Mon, 9 Jun 2003 01:57:43 +0000 Subject: [PATCH] stuff for writing git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353126 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/model/io/HWPFFileSystem.java | 31 ++++++++++++++++ .../poi/hwpf/model/io/HWPFOutputStream.java | 37 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java create mode 100644 src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFOutputStream.java diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java new file mode 100644 index 0000000000..723391e155 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java @@ -0,0 +1,31 @@ +package org.apache.poi.hwpf.model.io; + +/** + *

Title:

+ *

Description:

+ *

Copyright: Copyright (c) 2003

+ *

Company:

+ * @author not attributable + * @version 1.0 + */ + + +import java.io.ByteArrayOutputStream; +import java.util.HashMap; + +public class HWPFFileSystem +{ + HashMap _streams; + + public HWPFFileSystem() + { + _streams.put("WordDocument", new HWPFOutputStream()); + _streams.put("1Table", new HWPFOutputStream()); + } + + public HWPFOutputStream getStream(String name) + { + return (HWPFOutputStream)_streams.get(name); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFOutputStream.java b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFOutputStream.java new file mode 100644 index 0000000000..becb6dac54 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFOutputStream.java @@ -0,0 +1,37 @@ +package org.apache.poi.hwpf.model.io; + +import java.io.ByteArrayOutputStream; + +public class HWPFOutputStream extends ByteArrayOutputStream +{ + + int _offset; + + public HWPFOutputStream() + { + super(); + } + + public int getOffset() + { + return _offset; + } + + public void reset() + { + super.reset(); + _offset = 0; + } + + public void write(byte[] buf, int off, int len) + { + super.write(buf, off, len); + _offset += len; + } + + public void write(int b) + { + super.write(b); + _offset++; + } +}