Class
SizeHelper
Provides useful size-dedicated helper members.
public sealed class SizeHelperInheritance #
Inherited Members #
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| SizeHelper() |
Fields #
| Name | Description |
|---|---|
| UnitEb | Represents the number of bytes in one exibibyte (EiB). This is calculated as 1024 pebibytes. |
| UnitGb | Represents the number of bytes in one gibibyte (GiB). This is calculated as 1024 mebibytes. |
| UnitKb | Represents the number of bytes in one kibibyte (KiB). This is calculated as 1024 bytes. |
| UnitMb | Represents the number of bytes in one mebibyte (MiB). This is calculated as 1024 kibibytes. |
| UnitPb | Represents the number of bytes in one pebibyte (PiB). This is calculated as 1024 tebibytes. |
| UnitTb | Represents the number of bytes in one tebibyte (TiB). This is calculated as 1024 gibibytes. |
Methods #
| Name | Description |
|---|---|
| HumanReadableSize(long) | Converts a byte count into a human-readable string representation. |
| HumanReadableSize(double) | Converts a byte count into a human-readable string representation. |
| Parse(string) | Parses a human-readable size string (e.g., “10 KB”, “2.5 MB”) into a long representing the number of bytes. |