Capacity

Represents the amount of digital data something uses.

Capacity can represent ±8 exbibytes with byte-level accuracy.

To construct a Capacity, use the extension functions kibibytes, kilobytes, mebibytes, megabytes, and so on.

To get the value of this Capacity expressed in a particular CapacityUnit, use the functions toLong, toDouble, and so on.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun compareTo(other: Capacity): Int
Link copied to clipboard
operator fun minus(other: Capacity): Capacity

Subtracts other from this Capacity. This currently does not handle integer overflow.

Link copied to clipboard
operator fun plus(other: Capacity): Capacity

Adds other to this Capacity. This currently does not handle integer overflow.

Link copied to clipboard

Converts this Capacity to the given CapacityUnit, returning a Double representing the precise value.

Link copied to clipboard

Converts this Capacity to the given CapacityUnit, rounding to the nearest whole number.