poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject cvs commit: jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem SlowInputStream.java TestDocument.java
Date Thu, 31 Jul 2003 19:36:37 GMT
avik        2003/07/31 12:36:37

  Modified:    src/java/org/apache/poi/poifs/storage Tag: REL_2_BRANCH
                        DocumentBlock.java HeaderBlockReader.java
                        RawDataBlock.java
               src/testcases/org/apache/poi/poifs/filesystem Tag:
                        REL_2_BRANCH TestDocument.java
  Added:       src/java/org/apache/poi/util Tag: REL_2_BRANCH IOUtils.java
               src/testcases/org/apache/poi/poifs/filesystem Tag:
                        REL_2_BRANCH SlowInputStream.java
  Log:
  Slow input stream patch, bug 13478
  Thanks Tony Chao and Chris Nokleberg
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +2 -1      jakarta-poi/src/java/org/apache/poi/poifs/storage/DocumentBlock.java
  
  Index: DocumentBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/poifs/storage/DocumentBlock.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- DocumentBlock.java	30 Apr 2003 04:38:56 -0000	1.3
  +++ DocumentBlock.java	31 Jul 2003 19:36:37 -0000	1.3.2.1
  @@ -62,6 +62,7 @@
   import java.util.Arrays;
   
   import org.apache.poi.poifs.common.POIFSConstants;
  +import org.apache.poi.util.IOUtils;
   import org.apache.poi.util.IntegerField;
   import org.apache.poi.util.LittleEndian;
   import org.apache.poi.util.LittleEndianConsts;
  @@ -106,7 +107,7 @@
           throws IOException
       {
           this();
  -        int count = stream.read(_data);
  +        int count = IOUtils.readFully(stream, _data);
   
           _bytes_read = (count == -1) ? 0
                                       : count;
  
  
  
  1.3.2.1   +2 -1      jakarta-poi/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java
  
  Index: HeaderBlockReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- HeaderBlockReader.java	30 Apr 2003 04:38:57 -0000	1.3
  +++ HeaderBlockReader.java	31 Jul 2003 19:36:37 -0000	1.3.2.1
  @@ -60,6 +60,7 @@
   import java.util.*;
   
   import org.apache.poi.poifs.common.POIFSConstants;
  +import org.apache.poi.util.IOUtils;
   import org.apache.poi.util.IntegerField;
   import org.apache.poi.util.LittleEndian;
   import org.apache.poi.util.LittleEndianConsts;
  @@ -104,7 +105,7 @@
           throws IOException
       {
           _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ];
  -        int byte_count = stream.read(_data);
  +        int byte_count = IOUtils.readFully(stream, _data);
   
           if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
           {
  
  
  
  1.3.2.1   +2 -1      jakarta-poi/src/java/org/apache/poi/poifs/storage/RawDataBlock.java
  
  Index: RawDataBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/poifs/storage/RawDataBlock.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- RawDataBlock.java	30 Apr 2003 04:38:56 -0000	1.3
  +++ RawDataBlock.java	31 Jul 2003 19:36:37 -0000	1.3.2.1
  @@ -56,6 +56,7 @@
   package org.apache.poi.poifs.storage;
   
   import org.apache.poi.poifs.common.POIFSConstants;
  +import org.apache.poi.util.IOUtils;
   
   import java.io.*;
   
  @@ -84,7 +85,7 @@
           throws IOException
       {
           _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ];
  -        int count = stream.read(_data);
  +        int count = IOUtils.readFully(stream, _data);
   
           if (count == -1)
           {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      jakarta-poi/src/java/org/apache/poi/util/IOUtils.java
  
  Index: IOUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/util/IOUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java
  
  Index: TestDocument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- TestDocument.java	30 Apr 2003 04:39:11 -0000	1.2
  +++ TestDocument.java	31 Jul 2003 19:36:37 -0000	1.2.2.1
  @@ -107,7 +107,7 @@
           {
               array[ j ] = ( byte ) j;
           }
  -        document = new POIFSDocument("foo", new ByteArrayInputStream(array));
  +        document = new POIFSDocument("foo", new SlowInputStream(new ByteArrayInputStream(array)));
           checkDocument(document, array);
   
           // verify correct number of blocks get created for document
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java
  
  Index: SlowInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message