BinaryDataSize

Provides binary (base-1024) data size constants, following IEC standards (e.g., KiB, MiB). This is typically used for memory-related calculations, such as RAM or certain software contexts.

The constants are defined using bit-shifting for powers of 1024, ensuring accurate binary scaling. Extension properties (e.g., kib, mib) are provided for convenient conversion of Int, Long, and Double values to their respective binary data sizes.

For petabyte (pib) and exabyte (eib) conversions, use the Safe variants (e.g., pibSafe, eibSafe) to avoid overflow risks with large numbers.

See also

for decimal (base-1000) units

for the interface defining these constants

Properties

Link copied to clipboard
open override val exabyte: Long

Number of bytes in an exabyte (EB or EiB, depending on the implementation).

Link copied to clipboard
open override val gigabyte: Long

Number of bytes in a gigabyte (GB or GiB, depending on the implementation).

Link copied to clipboard
open override val kilobyte: Long

Number of bytes in a kilobyte (KB or KiB, depending on the implementation).

Link copied to clipboard
open override val megabyte: Long

Number of bytes in a megabyte (MB or MiB, depending on the implementation).

Link copied to clipboard
open override val petabyte: Long

Number of bytes in a petabyte (PB or PiB, depending on the implementation).

Link copied to clipboard
open override val terabyte: Long

Number of bytes in a terabyte (TB or TiB, depending on the implementation).