Package org.pentaho.di.core.util
Class StorageUnitConverter
java.lang.Object
org.pentaho.di.core.util.StorageUnitConverter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyteCountToDisplaySize
(long byteCount) Converts byte count to the human readable representation.long
displaySizeToByteCount
(String displaySize) Convert human human readable file size format to byte equivalent.
-
Constructor Details
-
StorageUnitConverter
public StorageUnitConverter()
-
-
Method Details
-
byteCountToDisplaySize
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
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
-