]> source.dussan.org Git - poi.git/commitdiff
Move the SBAT/BAT cutoff constant to POIFSConstants
authorNick Burch <nick@apache.org>
Mon, 27 Dec 2010 04:04:47 +0000 (04:04 +0000)
committerNick Burch <nick@apache.org>
Mon, 27 Dec 2010 04:04:47 +0000 (04:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1052995 13f79535-47bb-0310-9956-ffa450edef68

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

index 5a260f42104a8977421cd2c684eafd843c438b86..74bc037d135c8c9356d09927de891ee7cbc23e04 100644 (file)
@@ -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;
     
index edffb6b45aedc2772aa7011a7c5f4db3ee33c15f..947729f060c64b1b1c6fd7f25e4a1a6962b29388 100644 (file)
@@ -97,7 +97,7 @@ public class NPOIFSStream implements Iterable<ByteBuffer>
     * 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?
index c1e8c0e1c117dc1e6cce3ac4716f42043def5998..127dab1e391f2767144ed8303150bc1a9a470d23 100644 (file)
@@ -65,7 +65,7 @@ public abstract class Property implements Child, POIFSViewable {
     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;