Package org.pentaho.di.core.util
Class StorageUnitConverter
- java.lang.Object
-
- org.pentaho.di.core.util.StorageUnitConverter
-
public class StorageUnitConverter extends Object
-
-
Constructor Summary
Constructors Constructor Description StorageUnitConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
byteCountToDisplaySize(long byteCount)
Converts byte count to the human readable representation.long
displaySizeToByteCount(String displaySize)
Convert human human readable file size format to byte equivalent.
-
-
-
Method Detail
-
byteCountToDisplaySize
public String byteCountToDisplaySize(long byteCount)
Converts byte count to the human readable representation. The size is rounded to nearest X-byte.For example: 13.1MB in byte count will return 13MB and 13.9MB in byte count wil return 13MB.
Supported types: EB, PB, TB, GB, MB, KB or B (for bytes).
- Parameters:
byteCount
-- Returns:
- human reabable display size
-
displaySizeToByteCount
public long displaySizeToByteCount(String displaySize)
Convert human human readable file size format to byte equivalent.Accepted units:
- B - Bytes
- KB - Kilobytes
- MB - Megabytes
- GB - Gigabytes
"5MB"
"123B"
"1.5GB"
"1,5GB"- Parameters:
displaySize
- human readable size format- Returns:
- total number of bytes
-
-