-
Notifications
You must be signed in to change notification settings - Fork 1
Edge Cases
Arun Prakash edited this page Nov 29, 2025
·
2 revisions
- Invalid format throws
FormatExceptionByteConverter.parse('abc')BigByteConverter.parse('1.23 XB')
- Unknown units per selected standard throw
- e.g.,
ByteConverter.parse('1 KiB')with SI DataRate.parse('1 MB/s', standard: ByteStandard.iec)
- e.g.,
- Locale and separators
- NBSP:
"1\u00A0234,5 KB" - Underscore grouping:
"12_345.67 MB" - Ambiguous separators: last one is decimal ("1,234.56" and "1.234,56")
- NBSP:
- Negative values
- Parsing a negative size triggers
ArgumentErrorvia constructor validation
- Parsing a negative size triggers
- Zero handling
- Sizes:
ByteConverter(0).toHumanReadableAuto(signed: true)->" 0 B" - Rates:
DataRate.bitsPerSecond(0).toHumanReadableAuto(signed: true)->" 0 b/s"
- Sizes:
- Very large IEC rates (PiB/s, EiB/s, ZiB/s, YiB/s) supported