stuff for writing

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353126 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Said Ryan Ackley 2003-06-09 01:57:43 +00:00
parent 36fcee8b0e
commit 8c56d5ecd0
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package org.apache.poi.hwpf.model.io;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @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);
}
}

View File

@ -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++;
}
}