Humanizer.ByteSize
ByteSize Struct
public struct ByteSize : System.IComparable<Humanizer.ByteSize>, System.IEquatable<Humanizer.ByteSize>, System.IComparable, System.IFormattable
Implements System.IComparable<ByteSize>, System.IEquatable<ByteSize>, System.IComparable, System.IFormattable
Constructors
ByteSize(double) Constructor
public ByteSize(double byteSize);
Parameters
byteSize System.Double
Fields
ByteSize.Bit Field
public const string Bit = "bit";
Field Value
ByteSize.BitsInByte Field
public const long BitsInByte = 8;
Field Value
ByteSize.BitSymbol Field
public const string BitSymbol = "b";
Field Value
ByteSize.Byte Field
public const string Byte = "byte";
Field Value
ByteSize.BytesInGigabyte Field
public const long BytesInGigabyte = 1073741824;
Field Value
ByteSize.BytesInKilobyte Field
public const long BytesInKilobyte = 1024;
Field Value
ByteSize.BytesInMegabyte Field
public const long BytesInMegabyte = 1048576;
Field Value
ByteSize.BytesInTerabyte Field
public const long BytesInTerabyte = 1099511627776;
Field Value
ByteSize.ByteSymbol Field
public const string ByteSymbol = "B";
Field Value
ByteSize.Gigabyte Field
public const string Gigabyte = "gigabyte";
Field Value
ByteSize.GigabyteSymbol Field
public const string GigabyteSymbol = "GB";
Field Value
ByteSize.Kilobyte Field
public const string Kilobyte = "kilobyte";
Field Value
ByteSize.KilobyteSymbol Field
public const string KilobyteSymbol = "KB";
Field Value
ByteSize.MaxValue Field
public static readonly ByteSize MaxValue;
Field Value
ByteSize.Megabyte Field
public const string Megabyte = "megabyte";
Field Value
ByteSize.MegabyteSymbol Field
public const string MegabyteSymbol = "MB";
Field Value
ByteSize.MinValue Field
public static readonly ByteSize MinValue;
Field Value
ByteSize.Terabyte Field
public const string Terabyte = "terabyte";
Field Value
ByteSize.TerabyteSymbol Field
public const string TerabyteSymbol = "TB";
Field Value
Properties
ByteSize.Bits Property
public readonly long Bits { get; }
Property Value
ByteSize.Bytes Property
public readonly double Bytes { get; }
Property Value
ByteSize.Gigabytes Property
public readonly double Gigabytes { get; }
Property Value
ByteSize.Kilobytes Property
public readonly double Kilobytes { get; }
Property Value
ByteSize.LargestWholeNumberFullWord Property
public readonly string LargestWholeNumberFullWord { get; }
Property Value
ByteSize.LargestWholeNumberSymbol Property
public readonly string LargestWholeNumberSymbol { get; }
Property Value
ByteSize.LargestWholeNumberValue Property
public readonly double LargestWholeNumberValue { get; }
Property Value
ByteSize.Megabytes Property
public readonly double Megabytes { get; }
Property Value
ByteSize.Terabytes Property
public readonly double Terabytes { get; }
Property Value
Methods
ByteSize.Add(ByteSize) Method
public readonly Humanizer.ByteSize Add(Humanizer.ByteSize bs);
Parameters
bs ByteSize
Returns
ByteSize.AddBits(long) Method
public readonly Humanizer.ByteSize AddBits(long value);
Parameters
value System.Int64
Returns
ByteSize.AddBytes(double) Method
public readonly Humanizer.ByteSize AddBytes(double value);
Parameters
value System.Double
Returns
ByteSize.AddGigabytes(double) Method
public readonly Humanizer.ByteSize AddGigabytes(double value);
Parameters
value System.Double
Returns
ByteSize.AddKilobytes(double) Method
public readonly Humanizer.ByteSize AddKilobytes(double value);
Parameters
value System.Double
Returns
ByteSize.AddMegabytes(double) Method
public readonly Humanizer.ByteSize AddMegabytes(double value);
Parameters
value System.Double
Returns
ByteSize.AddTerabytes(double) Method
public readonly Humanizer.ByteSize AddTerabytes(double value);
Parameters
value System.Double
Returns
ByteSize.CompareTo(ByteSize) Method
public readonly int CompareTo(Humanizer.ByteSize other);
Parameters
other ByteSize
Returns
ByteSize.CompareTo(object) Method
public readonly int CompareTo(object? obj);
Parameters
obj System.Object
Implements CompareTo(object)
Returns
ByteSize.Equals(ByteSize) Method
public readonly bool Equals(Humanizer.ByteSize value);
Parameters
value ByteSize
Returns
ByteSize.Equals(object) Method
public override readonly bool Equals(object? value);
Parameters
value System.Object
Returns
ByteSize.FromBits(long) Method
public static Humanizer.ByteSize FromBits(long value);
Parameters
value System.Int64
Returns
ByteSize.FromBytes(double) Method
public static Humanizer.ByteSize FromBytes(double value);
Parameters
value System.Double
Returns
ByteSize.FromGigabytes(double) Method
public static Humanizer.ByteSize FromGigabytes(double value);
Parameters
value System.Double
Returns
ByteSize.FromKilobytes(double) Method
public static Humanizer.ByteSize FromKilobytes(double value);
Parameters
value System.Double
Returns
ByteSize.FromMegabytes(double) Method
public static Humanizer.ByteSize FromMegabytes(double value);
Parameters
value System.Double
Returns
ByteSize.FromTerabytes(double) Method
public static Humanizer.ByteSize FromTerabytes(double value);
Parameters
value System.Double
Returns
ByteSize.GetHashCode() Method
public override readonly int GetHashCode();
Returns
ByteSize.GetLargestWholeNumberFullWord(IFormatProvider) Method
public readonly string GetLargestWholeNumberFullWord(System.IFormatProvider? provider=null);
Parameters
provider System.IFormatProvider
Returns
ByteSize.GetLargestWholeNumberSymbol(IFormatProvider) Method
public readonly string GetLargestWholeNumberSymbol(System.IFormatProvider? provider=null);
Parameters
provider System.IFormatProvider
Returns
ByteSize.Parse(string) Method
public static Humanizer.ByteSize Parse(string s);
Parameters
Returns
ByteSize.Parse(string, IFormatProvider) Method
public static Humanizer.ByteSize Parse(string s, System.IFormatProvider? formatProvider);
Parameters
formatProvider System.IFormatProvider
Returns
ByteSize.Subtract(ByteSize) Method
public readonly Humanizer.ByteSize Subtract(Humanizer.ByteSize bs);
Parameters
bs ByteSize
Returns
ByteSize.ToFullWords(string, IFormatProvider) Method
Converts the value of the current ByteSize object to a string with full words. The metric prefix symbol (bit, byte, kilo, mega, giga, tera) used is the largest metric prefix such that the corresponding value is greater than or equal to one.
public readonly string ToFullWords(string? format=null, System.IFormatProvider? provider=null);
Parameters
format System.String
provider System.IFormatProvider
Returns
ByteSize.ToString() Method
Converts the value of the current ByteSize object to a string. The metric prefix symbol (bit, byte, kilo, mega, giga, tera) used is the largest metric prefix such that the corresponding value is greater than or equal to one.
public override readonly string ToString();
Returns
ByteSize.ToString(string) Method
public readonly string ToString(string? format);
Parameters
format System.String
Returns
ByteSize.ToString(string, IFormatProvider) Method
public readonly string ToString(string? format, System.IFormatProvider? provider);
Parameters
format System.String
provider System.IFormatProvider
Implements ToString(string, IFormatProvider)
Returns
ByteSize.ToString(IFormatProvider) Method
public readonly string ToString(System.IFormatProvider? provider);
Parameters
provider System.IFormatProvider
Returns
ByteSize.TryParse(string, ByteSize) Method
public static bool TryParse(string? s, out Humanizer.ByteSize result);
Parameters
result ByteSize
Returns
ByteSize.TryParse(string, IFormatProvider, ByteSize) Method
public static bool TryParse(string? s, System.IFormatProvider? formatProvider, out Humanizer.ByteSize result);
Parameters
formatProvider System.IFormatProvider
result ByteSize
Returns
ByteSize.TryParse(ReadOnlySpan<char>, ByteSize) Method
public static bool TryParse(System.ReadOnlySpan<char> s, out Humanizer.ByteSize result);
Parameters
s System.ReadOnlySpan<System.Char>
result ByteSize
Returns
ByteSize.TryParse(ReadOnlySpan<char>, IFormatProvider, ByteSize) Method
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? formatProvider, out Humanizer.ByteSize result);
Parameters
s System.ReadOnlySpan<System.Char>
formatProvider System.IFormatProvider
result ByteSize
Returns
Operators
ByteSize.operator +(ByteSize, ByteSize) Operator
public static Humanizer.ByteSize operator +(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator --(ByteSize) Operator
public static Humanizer.ByteSize operator --(Humanizer.ByteSize b);
Parameters
b ByteSize
Returns
ByteSize.operator ==(ByteSize, ByteSize) Operator
public static bool operator ==(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator >(ByteSize, ByteSize) Operator
public static bool operator >(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator >=(ByteSize, ByteSize) Operator
public static bool operator >=(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator ++(ByteSize) Operator
public static Humanizer.ByteSize operator ++(Humanizer.ByteSize b);
Parameters
b ByteSize
Returns
ByteSize.operator !=(ByteSize, ByteSize) Operator
public static bool operator !=(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator <(ByteSize, ByteSize) Operator
public static bool operator <(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator <=(ByteSize, ByteSize) Operator
public static bool operator <=(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator -(ByteSize, ByteSize) Operator
public static Humanizer.ByteSize operator -(Humanizer.ByteSize b1, Humanizer.ByteSize b2);
Parameters
b1 ByteSize
b2 ByteSize
Returns
ByteSize.operator -(ByteSize) Operator
public static Humanizer.ByteSize operator -(Humanizer.ByteSize b);
Parameters
b ByteSize