org.nuxeo.common.utils
Class SizeUtils
java.lang.Object
org.nuxeo.common.utils.SizeUtils
public class SizeUtils
- extends Object
Class containing helpers related to the expression of sizes in bytes,
kilobytes, etc.
Field Summary |
static long |
GB
|
static long |
KB
|
static long |
MB
|
static long |
TB
|
Method Summary |
static long |
parseSizeInBytes(String string)
Returns the number of bytes corresponding to a string expressing a size. |
KB
public static final long KB
- See Also:
- Constant Field Values
MB
public static final long MB
- See Also:
- Constant Field Values
GB
public static final long GB
- See Also:
- Constant Field Values
TB
public static final long TB
- See Also:
- Constant Field Values
parseSizeInBytes
public static long parseSizeInBytes(String string)
throws NumberFormatException
- 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
Copyright © 2011 Nuxeo SAS. All Rights Reserved.