poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1052995 - in /poi/trunk/src/java/org/apache/poi/poifs: common/POIFSConstants.java filesystem/NPOIFSStream.java property/Property.java
Date Mon, 27 Dec 2010 04:04:48 GMT
Author: nick
Date: Mon Dec 27 04:04:47 2010
New Revision: 1052995

URL: http://svn.apache.org/viewvc?rev=1052995&view=rev
Log:
Move the SBAT/BAT cutoff constant to POIFSConstants

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/common/POIFSConstants.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSStream.java
    poi/trunk/src/java/org/apache/poi/poifs/property/Property.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/common/POIFSConstants.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/common/POIFSConstants.java?rev=1052995&r1=1052994&r2=1052995&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/common/POIFSConstants.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/common/POIFSConstants.java Mon Dec 27 04:04:47
2010
@@ -35,6 +35,13 @@ public interface POIFSConstants
     
     public static final int PROPERTY_SIZE  = 0x0080;
     
+    /** 
+     * The minimum size of a document before it's stored using 
+     *  Big Blocks (normal streams). Smaller documents go in the 
+     *  Mini Stream (SBAT / Small Blocks)
+     */
+    public static final int BIG_BLOCK_MINIMUM_DOCUMENT_SIZE = 0x1000;
+    
     /** The highest sector number you're allowed, 0xFFFFFFFA */
     public static final int LARGEST_REGULAR_SECTOR_NUMBER = -5;
     

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSStream.java?rev=1052995&r1=1052994&r2=1052995&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSStream.java Mon Dec 27 04:04:47
2010
@@ -97,7 +97,7 @@ public class NPOIFSStream implements Ite
     * Updates the contents of the stream to the new
     *  set of bytes.
     * Note - if this is property based, you'll still
-    *  need to 
+    *  need to update the size in the property yourself
     */
    public void updateContents(byte[] contents) throws IOException {
       // How many blocks are we going to need?

Modified: poi/trunk/src/java/org/apache/poi/poifs/property/Property.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/Property.java?rev=1052995&r1=1052994&r2=1052995&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/Property.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/Property.java Mon Dec 27 04:04:47 2010
@@ -65,7 +65,7 @@ public abstract class Property implement
     static final protected byte _NODE_RED                 = 0;
 
     // documents must be at least this size to be stored in big blocks
-    static final private int    _big_block_minimum_bytes  = 4096;
+    static final private int    _big_block_minimum_bytes  = POIFSConstants.BIG_BLOCK_MINIMUM_DOCUMENT_SIZE;
     private String              _name;
     private ShortField          _name_size;
     private ByteField           _property_type;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message