-
The range of quantifiers for binary units (bytes to terabytes (ISO: B to TiB))
The range of quantifiers for ISO decimal units (bytes to terabytes (ISO: B to TB))
Attempts to locate the most appropriate binary unit (binary units are what everyone but the ISO and the storage industry
mean by "KB", "MB", etc.
Attempts to locate the most appropriate decimal unit (decimal units are what the ISO and the storage industry (but nobody
else) mean by "KB", "MB", etc.
Attempts to locate the most appropriate of the provided units to express the provided amount in for human use (balancing
precision and sensible expression)
The unit which this Storage Size should be expressed by default
Returns the the larger unit of unit
and unit2
Parse the non-ISO abbreviation: MiB and MB both -> MEGABYTE (which is technically a "Mebibyte")
Parse the ISO abbreviation: (e.g.
Returns the the most diminutive unit of unit
and unit2
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
int
Performs a comparison based on the number of bits represented
Since this class has a natural ordering that is inconsistent with equals, this method may return 0 where
equals
would not return 0
- since this compares based on bits but equals tests based on the
unit+amount
Convert this StorageSize to use the named unit
long
Converts the size of this StorageSize to another unit, rounding the result to an integer
This method may result in the loss of information (due to rounding).
Attempts to locate the most appropriate binary unit (binary units are what everyone but the ISO and the storage industry
mean by "KB", "MB", etc.
Attempts to locate the most appropriate decimal unit (decimal units are what the ISO and the storage industry (but nobody
else) mean by "KB", "MB", etc.
Attempts to locate the most appropriate of the provided units to express the provided amount in for human use (balancing
precision and sensible expression)
Converts the size of this StorageSize to another unit, returning the result as a real number (using the BigDecimal type)
The calculations may result in minimal loss of precision, however this is unavoidable.
Returns the the larger unit of unit
and unit2
Returns the the most diminutive unit of unit
and unit2
Return a String version of this size (e.g.
Return a short ISO String version of this size using the provided unit (e.g.
protected
Creates a new StorageSize where the value is an approximation of the provided value
Since this is an approximation some information may be lost.
Creates a new StorageSize where the value is equal to the provided value
If the unit is in BITS then any fractional bytes resulting from the conversion will be discarded (e.g.