poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sack...@apache.org
Subject cvs commit: jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/io HWPFOutputStream.java HWPFFileSystem.java
Date Mon, 09 Jun 2003 01:57:43 GMT
sackley     2003/06/08 18:57:43

  Added:       src/scratchpad/src/org/apache/poi/hwpf/model/io
                        HWPFOutputStream.java HWPFFileSystem.java
  Log:
  stuff for writing
  
  Revision  Changes    Path
  1.1                  jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFOutputStream.java
  
  Index: HWPFOutputStream.java
  ===================================================================
  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++;
    }
  }
  
  
  
  1.1                  jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/io/HWPFFileSystem.java
  
  Index: HWPFFileSystem.java
  ===================================================================
  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);
    }
  
  }
  
  
  

Mime
View raw message