DataSize constructor

DataSize({
  1. int kilobytes = 0,
  2. int megabytes = 0,
  3. int gigabytes = 0,
  4. int terabytes = 0,
  5. int bytes = 0,
})

Create DataSize object with predefined size as optional.

Implementation

DataSize({
  int kilobytes = 0,
  int megabytes = 0,
  int gigabytes = 0,
  int terabytes = 0,
  int bytes = 0,
}) {
  realSize = bytes;
  realSize += kilobytes * bytesInKilo;
  realSize += megabytes * byteInMega;
  realSize += gigabytes * bytesInGiga;
  realSize += terabytes * bytesInTera;
}