- java.lang.Object
-
- de.siegmar.fastcsv.util.Limits
-
public final class Limits extends java.lang.Object
TheLimits
class defines the maximum limits for various fields and records in a CSV file.Limits can be overridden by setting system properties. Example use:
Or using VM options:
-Dfastcsv.max.field.count=8388608 -Dfastcsv.max.field.count=8192
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_FIELD_COUNT
TheMAX_FIELDS_SIZE
constant defines the maximum number of fields per record.static int
MAX_FIELD_SIZE
TheMAX_FIELD_SIZE
constant defines the maximum size for a single field in a CSV file.static int
MAX_RECORD_SIZE
TheMAX_RECORD_SIZE
constant defines the maximum size for all fields combined in a CSV record.
-
Constructor Summary
Constructors Modifier Constructor Description private
Limits()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
getIntProperty(java.lang.String key, int defaultValue)
Retrieves the system property value if presented, otherwise the default value is returned.
-
-
-
Field Detail
-
MAX_FIELD_SIZE
public static final int MAX_FIELD_SIZE
TheMAX_FIELD_SIZE
constant defines the maximum size for a single field in a CSV file. The value is set to 16,777,216 characters (16 to 64 MiB depending on the circumstance of multibyte character utilization).The default value can be overridden by setting the system property
fastcsv.max.field.size
(e.g., using-Dfastcsv.max.field.size=8388608
).
-
MAX_FIELD_COUNT
public static final int MAX_FIELD_COUNT
TheMAX_FIELDS_SIZE
constant defines the maximum number of fields per record. The value is set to 16,384.The default value can be overridden by setting the system property
fastcsv.max.field.count
(e.g., using-Dfastcsv.max.field.count=8192
).
-
MAX_RECORD_SIZE
public static final int MAX_RECORD_SIZE
TheMAX_RECORD_SIZE
constant defines the maximum size for all fields combined in a CSV record. The value is set to four times ofMAX_FIELD_SIZE
.
-
-
Method Detail
-
getIntProperty
static int getIntProperty(java.lang.String key, int defaultValue)
Retrieves the system property value if presented, otherwise the default value is returned. If the property cannot be parsed as an integer, anIllegalArgumentException
is thrown.- Parameters:
key
- The system property key.defaultValue
- The default value to use if the system property is not set or is invalid.- Returns:
- The system property value as an integer or the default value if the property is not set or is invalid.
- Throws:
java.lang.IllegalArgumentException
- If the system property value cannot be parsed as an integer.
-
-