Represents a size in bytes.
public struct ByteSize : IEquatable<ByteSize>
ValueSummary: Gets the size in bytes.
bool Equals(ByteSize other)Summary: Equals the specified other.
Parameters:
other
- The other.
bool Equals(object obj)Summary: Equals the specified other.
Parameters:
other
- The other.
string Format()Summary: Returns a
System.String
that represents this instance.Returns: A
System.String
that represents this instance.Remarks: The size is formatted to a human readable format using the default formatter (
Atc.Units.DigitalInformation.ByteSizeFormatter.Default
).
string Format(ByteSizeFormatter formatter)Summary: Returns a
System.String
that represents this instance.Returns: A
System.String
that represents this instance.Remarks: The size is formatted to a human readable format using the default formatter (
Atc.Units.DigitalInformation.ByteSizeFormatter.Default
).
int GetHashCode()
string ToString()Summary: Returns a
System.String
that represents this instance.Returns: A
System.String
that represents this instance.Remarks: The size is formatted to a human readable format using the default formatter (
Atc.Units.DigitalInformation.ByteSizeFormatter.Default
).
string ToString(ByteSizeFormatter formatter)Summary: Returns a
System.String
that represents this instance.Returns: A
System.String
that represents this instance.Remarks: The size is formatted to a human readable format using the default formatter (
Atc.Units.DigitalInformation.ByteSizeFormatter.Default
).
A formatter that converts a byte size to a human readable string.
public class ByteSizeFormatter
DefaultSummary: Returns a default instance of ByteSizeFormatter. This formatter will be used by the ByteSize.ToString() method.
MaxUnitSummary: Gets or sets the largest unit used by the formatter.
MinUnitSummary: Gets or sets the smallest unit used by the formatter.
NumberFormatInfoSummary: Gets or sets the number format information.
NumberOfDecimalsSummary: Gets or sets the number of decimals.
RoundingRuleSummary: Gets or sets the rounding rule.
SuffixFormatSummary: Gets or sets a value indicating whether the suffix format should be short or full wording.
string Format(long size)Summary: Formats the specified size.
Parameters:
size
- The size to format.Returns: The formatted size.
Defines rounding rules for byte sizes
public enum ByteSizeRoundingRuleType
Value | Name | Description | Summary |
---|---|---|---|
0 | Closest | Closest | Rounded to the closest value |
1 | Down | Down | Rounded to the lower value |
2 | Up | Up | Rounded to the upper value |
Enumeration: Format the suffix word.
public enum ByteSizeSuffixType
Value | Name | Description | Summary |
---|---|---|---|
0 | None | None | |
1 | Short | Short | Short like: KB, GB etc. |
2 | Full | Full | Full like: Kilobyte, Gigabyte etc. |
Enumeration: Defines units for byte sizes.
public enum ByteSizeUnitType
Value | Name | Description | Summary |
---|---|---|---|
0 | Byte | Byte | Byte. |
1 | Kilobyte | Kilobyte | Kilobyte. |
2 | Megabyte | Megabyte | Megabyte. |
3 | Gigabyte | Gigabyte | Gigabyte. |
4 | Terabyte | Terabyte | Terabyte. |
5 | Petabyte | Petabyte | Petabyte. |
6 | Exabyte | Exabyte | Exabyte. |