ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time.
The units being used in this project are actually kibibyte, mebibyte, gibibyte etc instead of kilobyte, megabyte, gigabyte (MiB for mebibyte, MB for megabyte) which may cause confusion.
Kilobyte is 1000 bytes (power of 10), but a kibibyte is 1024 bytes (power of 2).
The units being used in this project are actually kibibyte, mebibyte, gibibyte etc instead of kilobyte, megabyte, gigabyte (MiB for mebibyte, MB for megabyte) which may cause confusion. Kilobyte is 1000 bytes (power of 10), but a kibibyte is 1024 bytes (power of 2).
More info on what a kibibyte is: https://en.wikipedia.org/wiki/Kibibyte