diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-10-22 21:08:53 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-10-22 21:08:53 +0000 |
commit | c0cc8811145ebed58b0e380e802d263d12da96c4 (patch) | |
tree | 329a1954806c34f179f5980d3babd83e2e10046b /poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java | |
parent | 5b554e753474e8ae31cb777635fb7ab214899f8d (diff) | |
download | poi-c0cc8811145ebed58b0e380e802d263d12da96c4.tar.gz poi-c0cc8811145ebed58b0e380e802d263d12da96c4.zip |
more support for configurable max record len
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894494 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java')
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java index 6571c650af..e103c3367b 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java @@ -83,7 +83,8 @@ public final class HWPFDocument extends HWPFDocumentCore { /*package*/ static final String PROPERTY_PRESERVE_BIN_TABLES = "org.apache.poi.hwpf.preserveBinTables"; private static final String PROPERTY_PRESERVE_TEXT_TABLE = "org.apache.poi.hwpf.preserveTextTable"; //arbitrarily selected; may need to increase - private static final int MAX_RECORD_LENGTH = 1_000_000; + private static final int DEFAULT_MAX_RECORD_LENGTH = 100_000; + private static int MAX_RECORD_LENGTH = DEFAULT_MAX_RECORD_LENGTH; private static final String STREAM_DATA = "Data"; @@ -194,6 +195,20 @@ public final class HWPFDocument extends HWPFDocumentCore { private Fields _fields; /** + * @param length the max record length allowed for HWPFDocument + */ + public static void setMaxRecordLength(int length) { + MAX_RECORD_LENGTH = length; + } + + /** + * @return the max record length allowed for HWPFDocument + */ + public static int getMaxRecordLength() { + return MAX_RECORD_LENGTH; + } + + /** * This constructor loads a Word document from an InputStream. * * @param istream The InputStream that contains the Word document. |