public class MemorySize
extends java.lang.Object
Convenience class to convert memory size value specified as 'nK' for kilobytes, 'nM' for megabytes and 'nG' for gigabytes, to an absolute value.
Modifier and Type | Field and Description |
---|---|
static long |
GIGABYTE |
static long |
KILOBYTE |
static long |
MEGABYTE |
static long |
TERABYTE |
Constructor and Description |
---|
MemorySize() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
asGigabyteString(long val)
Return a byte value as a gigabyte string
|
static java.lang.String |
asKilobyteString(long val)
Return a byte value as a kilobyte string
|
static java.lang.String |
asMegabyteString(long val)
Return a byte value as a megabyte string
|
static java.lang.String |
asScaledString(long val)
Return a byte value as a scaled string
|
static java.lang.String |
asTerabyteString(long val)
Return a byte value as a terabyte string
|
static long |
getByteValue(java.lang.String memSize)
Convert a memory size to a byte value
|
static int |
getByteValueInt(java.lang.String memSize)
Convert a memory size to an integer byte value.
|
static int |
roundupIntSize(int iSize)
Round up the size value to a 512 byte boundary
|
static long |
roundupLongSize(long lSize)
Round up the size value to a 512 byte boundary
|
public static final long KILOBYTE
public static final long MEGABYTE
public static final long GIGABYTE
public static final long TERABYTE
public static final int getByteValueInt(java.lang.String memSize)
memSize
- Stringjava.lang.NumberFormatException
public static final long getByteValue(java.lang.String memSize)
memSize
- Stringjava.lang.NumberFormatException
public static final java.lang.String asKilobyteString(long val)
val
- longpublic static final java.lang.String asMegabyteString(long val)
val
- longpublic static final java.lang.String asGigabyteString(long val)
val
- longpublic static final java.lang.String asTerabyteString(long val)
val
- longpublic static final java.lang.String asScaledString(long val)
val
- longpublic static long roundupLongSize(long lSize)
lSize
- longpublic static int roundupIntSize(int iSize)
iSize
- intCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.