File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
io/src/main/java/com/itextpdf/io/source Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,15 @@ This file is part of the iText (R) project.
6060 */
6161public final class RandomAccessSourceFactory {
6262
63+ /**
64+ * The default value for the forceRead flag
65+ */
66+ private static boolean forceReadDefaultValue = false ;
6367
6468 /**
6569 * Whether the full content of the source should be read into memory at construction
6670 */
67- private boolean forceRead = false ;
71+ private boolean forceRead = forceReadDefaultValue ;
6872
6973 /**
7074 * Whether {@link java.io.RandomAccessFile} should be used instead of a {@link java.nio.channels.FileChannel}, where applicable
@@ -82,6 +86,14 @@ public final class RandomAccessSourceFactory {
8286 public RandomAccessSourceFactory () {
8387 }
8488
89+ /**
90+ * Determines the default value for the forceRead flag
91+ * @param forceRead true if by default the full content will be read, false otherwise
92+ */
93+ public static void setForceReadDefaultValue (boolean forceRead ) {
94+ forceReadDefaultValue = forceRead ;
95+ }
96+
8597 /**
8698 * Determines whether the full content of the source will be read into memory
8799 * @param forceRead true if the full content will be read, false otherwise
You can’t perform that action at this time.
0 commit comments