ByteConstants class abstract
Named constants for common byte sizes.
Provides easy access to well-known sizes for media, cloud services, and common file size limits.
Example:
// Check if file exceeds GitHub's limit
if (fileSize > ByteConstants.githubMaxFile) {
print('File too large for GitHub!');
}
// Compare to media capacity
print('This would fill ${fileSize.bytes / ByteConstants.cd700.bytes} CDs');
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- addressSpace32bit → ByteConverter
-
32-bit address space limit (4 GB)
final
- awsLambdaUnzipped → ByteConverter
-
AWS Lambda deployment package limit (250 MB unzipped)
final
- awsLambdaZipped → ByteConverter
-
AWS Lambda deployment package limit (50 MB zipped)
final
- azureFunctionsLimit → ByteConverter
-
Azure Functions limit (1.5 GB)
final
- bluray100 → ByteConverter
-
Blu-ray Triple Layer (100 GB)
final
- bluray128 → ByteConverter
-
Blu-ray Quad Layer (128 GB)
final
- bluray25 → ByteConverter
-
Blu-ray Single Layer (25 GB)
final
- bluray50 → ByteConverter
-
Blu-ray Dual Layer (50 GB)
final
- byte → ByteConverter
-
1 byte
final
- cd650 → ByteConverter
-
CD-ROM (650 MB, older standard)
final
- cd700 → ByteConverter
-
CD-ROM (700 MB)
final
-
cloudLimits
→ List<
({String name, ByteConverter size})> -
Returns a list of all cloud service limits.
no setter
- dockerLayerWarning → ByteConverter
-
Docker layer size warning threshold
final
- dvdDualLayer → ByteConverter
-
DVD Dual Layer (8.5 GB)
final
- dvdSingleLayer → ByteConverter
-
DVD Single Layer (4.7 GB)
final
-
emailLimits
→ List<
({String name, ByteConverter size})> -
Returns a list of email attachment limits.
no setter
- ethernetMtu → ByteConverter
-
Typical MTU for Ethernet (1500 bytes)
final
- fat32MaxFile → ByteConverter
-
FAT32 maximum file size (4 GB - 1 byte, rounded)
final
- flacPerMinute → ByteConverter
-
Typical 1-minute FLAC (~25 MB)
final
- floppy144 → ByteConverter
-
3.5" High Density Floppy Disk (1.44 MB)
final
- floppy720 → ByteConverter
-
3.5" Double Density Floppy Disk (720 KB)
final
- gcfLimit → ByteConverter
-
Google Cloud Functions limit (100 MB)
final
- gibibyte → ByteConverter
-
1 gibibyte (IEC, 1024³ bytes)
final
- gigabyte → ByteConverter
-
1 gigabyte (SI)
final
- githubLargeFileWarning → ByteConverter
-
GitHub recommended large file threshold (50 MB)
final
- githubMaxFile → ByteConverter
-
GitHub maximum file size (100 MB)
final
- githubRepoWarning → ByteConverter
-
GitHub repository recommended limit (1 GB)
final
- gmailAttachment → ByteConverter
-
Gmail attachment limit (25 MB)
final
- jumboFrameMtu → ByteConverter
-
Jumbo frame MTU (9000 bytes)
final
- kibibyte → ByteConverter
-
1 kibibyte (IEC, 1024 bytes)
final
- kilobyte → ByteConverter
-
1 kilobyte (SI)
final
- mbrPartitionLimit → ByteConverter
-
MBR partition limit (2 TB)
final
- mebibyte → ByteConverter
-
1 mebibyte (IEC, 1024² bytes)
final
- megabyte → ByteConverter
-
1 megabyte (SI)
final
- mp3PerMinute128 → ByteConverter
-
Typical 1-minute MP3 at 128 kbps (~1 MB)
final
- mp3PerMinute320 → ByteConverter
-
Typical 1-minute MP3 at 320 kbps (~2.4 MB)
final
- npmMaxPackage → ByteConverter
-
npm package maximum size (bundled)
final
- outlookAttachment → ByteConverter
-
Outlook/Office 365 attachment limit (20 MB, may vary)
final
- pebibyte → ByteConverter
-
1 pebibyte (IEC, 1024⁵ bytes)
final
- petabyte → ByteConverter
-
1 petabyte (SI)
final
-
physicalMedia
→ List<
({String name, ByteConverter size})> -
Returns a list of all physical media constants.
no setter
- tcpMss → ByteConverter
-
TCP maximum segment size typical (1460 bytes)
final
- tebibyte → ByteConverter
-
1 tebibyte (IEC, 1024⁴ bytes)
final
- terabyte → ByteConverter
-
1 terabyte (SI)
final
- video1080pPerMinute → ByteConverter
-
Typical 1-minute 1080p video (~150 MB)
final
- video4kPerMinute → ByteConverter
-
Typical 1-minute 4K video (~350 MB)
final
- yahooAttachment → ByteConverter
-
Yahoo Mail attachment limit (25 MB)
final
- zip100 → ByteConverter
-
Zip Disk 100 MB
final
- zip250 → ByteConverter
-
Zip Disk 250 MB
final
Static Methods
-
closestMediaFor(
ByteConverter size) → ({String name, ByteConverter size})? - Finds the closest physical media that can hold the given size.
-
mediaCountNeeded(
ByteConverter size, ByteConverter mediaSize) → int - Calculates how many of a given media type would be needed.