Struct ByteSize
A type for handling byte sizes.
Assembly: Emby.Media.Model.dll
public struct ByteSize : IComparable<ByteSize>, IEquatable<ByteSize>
Constructors
Declaration
public ByteSize(long bytes)
Parameters
Type |
Name |
Description |
System.Int64 |
bytes |
|
Properties
Declaration
public readonly long Bytes { get; }
Property Value
Type |
Description |
System.Int64 |
|
Declaration
public readonly double GB { get; }
Property Value
Type |
Description |
System.Double |
|
Declaration
public readonly double kB { get; }
Property Value
Type |
Description |
System.Double |
|
Declaration
public readonly double MB { get; }
Property Value
Type |
Description |
System.Double |
|
Methods
Declaration
public int CompareTo(ByteSize other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Declaration
public bool Equals(ByteSize other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
Declaration
public static ByteSize FromGB(double bytes)
Parameters
Type |
Name |
Description |
System.Double |
bytes |
|
Returns
Declaration
public static ByteSize FromGB(long bytes)
Parameters
Type |
Name |
Description |
System.Int64 |
bytes |
|
Returns
Declaration
public static ByteSize FromkB(double bytes)
Parameters
Type |
Name |
Description |
System.Double |
bytes |
|
Returns
Declaration
public static ByteSize FromkB(long bytes)
Parameters
Type |
Name |
Description |
System.Int64 |
bytes |
|
Returns
Declaration
public static ByteSize FromMB(double bytes)
Parameters
Type |
Name |
Description |
System.Double |
bytes |
|
Returns
Declaration
public static ByteSize FromMB(long bytes)
Parameters
Type |
Name |
Description |
System.Int64 |
bytes |
|
Returns
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
Declaration
public string ToBytesString()
Returns
Type |
Description |
System.String |
|
Declaration
public string ToGBString(string format = "N1")
Parameters
Type |
Name |
Description |
System.String |
format |
|
Returns
Type |
Description |
System.String |
|
Declaration
public string TokBString(string format = "N1")
Parameters
Type |
Name |
Description |
System.String |
format |
|
Returns
Type |
Description |
System.String |
|
Declaration
public string ToMBString(string format = "N1")
Parameters
Type |
Name |
Description |
System.String |
format |
|
Returns
Type |
Description |
System.String |
|
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Operators
Declaration
public static bool operator ==(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool operator>(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool operator >=(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static implicit operator long (ByteSize bytes)
Parameters
Returns
Type |
Description |
System.Int64 |
|
Declaration
public static implicit operator ByteSize(long bytes)
Parameters
Type |
Name |
Description |
System.Int64 |
bytes |
|
Returns
Declaration
public static bool operator !=(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool operator <(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool operator <=(ByteSize left, ByteSize right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IComparable<T>
System.IEquatable<T>
Extension Methods
See Also
System.IComparable
System.IEquatable<T>