Move the SBAT/BAT cutoff constant to POIFSConstants

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1052995 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2010-12-27 04:04:47 +00:00
parent cd216b6f0b
commit 17c775625c
3 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,13 @@ public interface POIFSConstants
public static final int PROPERTY_SIZE = 0x0080; 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 */ /** The highest sector number you're allowed, 0xFFFFFFFA */
public static final int LARGEST_REGULAR_SECTOR_NUMBER = -5; public static final int LARGEST_REGULAR_SECTOR_NUMBER = -5;

View File

@ -97,7 +97,7 @@ public class NPOIFSStream implements Iterable<ByteBuffer>
* Updates the contents of the stream to the new * Updates the contents of the stream to the new
* set of bytes. * set of bytes.
* Note - if this is property based, you'll still * 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 { public void updateContents(byte[] contents) throws IOException {
// How many blocks are we going to need? // How many blocks are we going to need?

View File

@ -65,7 +65,7 @@ public abstract class Property implements Child, POIFSViewable {
static final protected byte _NODE_RED = 0; static final protected byte _NODE_RED = 0;
// documents must be at least this size to be stored in big blocks // 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 String _name;
private ShortField _name_size; private ShortField _name_size;
private ByteField _property_type; private ByteField _property_type;