Skip to content

Commit 5cc5795

Browse files
author
Alexander Kozlov
committed
Add option to setup the default value for the forceRead flag
DEVSIX-6279
1 parent ce9a972 commit 5cc5795

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

itext/itext.io/itext/io/source/RandomAccessSourceFactory.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ namespace iText.IO.Source
5656
/// </summary>
5757
public sealed class RandomAccessSourceFactory
5858
{
59-
/// <summary>Whether the full content of the source should be read into memory at construction
60-
/// </summary>
61-
private bool forceRead = false;
59+
/// <summary>The default value for the forceRead flag
60+
/// </summary>
61+
private static bool forceReadDefaultValue = false;
62+
63+
/// <summary>Whether the full content of the source should be read into memory at construction
64+
/// </summary>
65+
private bool forceRead = false;
6266

6367
/// <summary>Whether the underlying file should have a RW lock on it or just an R lock
6468
/// </summary>
@@ -70,12 +74,19 @@ public RandomAccessSourceFactory()
7074
{
7175
}
7276

77+
/// <summary>Determines the default value for the forceRead flag
78+
/// </summary>
79+
/// <param name="forceRead">true if by default the full content will be read, false otherwise</param>
80+
public static void SetForceReadDefaultValue(bool forceRead)
81+
{
82+
forceReadDefaultValue = forceRead;
83+
}
84+
7385
/// <summary>Determines whether the full content of the source will be read into memory
7486
/// </summary>
7587
/// <param name="forceRead">true if the full content will be read, false otherwise</param>
7688
/// <returns>this object (this allows chaining of method calls)</returns>
77-
public RandomAccessSourceFactory SetForceRead(bool forceRead
78-
)
89+
public RandomAccessSourceFactory SetForceRead(bool forceRead)
7990
{
8091
this.forceRead = forceRead;
8192
return this;

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
afca8dfd654dea536057f3bd559b35ec9c6a7d89
1+
52e1c5a8eb98fae8f7522207808bdc859fa9559b

0 commit comments

Comments
 (0)