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 000000000..723391e15 --- /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 000000000..becb6dac5 --- /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++; + } +}