Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.common.utils
Class SizeUtils

java.lang.Object
  extended by 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

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

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.