Package org.nuxeo.common.utils
Class SizeUtils
java.lang.Object
org.nuxeo.common.utils.SizeUtils
Class containing helpers related to the expression of sizes in bytes, kilobytes, etc.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
parseSizeInBytes
(String string) Returns the number of bytes corresponding to a string expressing a size.
-
Field Details
-
KB
public static final long KB- See Also:
-
MB
public static final long MB- See Also:
-
GB
public static final long GB- See Also:
-
TB
public static final long TB- See Also:
-
-
Method Details
-
parseSizeInBytes
Returns the number of bytes corresponding to a string expressing a size.The suffixes KB, MB, GB, TB are recognized (in any case).
- Parameters:
string
- the size as a string- Returns:
- the size
- Throws:
NumberFormatException
- if the size cannot be parsed
-