public class MemorySize extends 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 String |
asGigabyteString(long val)
Return a byte value as a gigabyte string
|
static String |
asKilobyteString(long val)
Return a byte value as a kilobyte string
|
static String |
asMegabyteString(long val)
Return a byte value as a megabyte string
|
static String |
asScaledString(long val)
Return a byte value as a scaled string
|
static String |
asTerabyteString(long val)
Return a byte value as a terabyte string
|
static long |
getByteValue(String memSize)
Convert a memory size to a byte value
|
static int |
getByteValueInt(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(String memSize)
memSize - StringNumberFormatExceptionpublic static final long getByteValue(String memSize)
memSize - StringNumberFormatExceptionpublic static final String asKilobyteString(long val)
val - longpublic static final String asMegabyteString(long val)
val - longpublic static final String asGigabyteString(long val)
val - longpublic static final String asTerabyteString(long val)
val - longpublic static final String asScaledString(long val)
val - longpublic static long roundupLongSize(long lSize)
lSize - longpublic static int roundupIntSize(int iSize)
iSize - intCopyright © 2005–2020 Alfresco Software. All rights reserved.