Class ByteCapacity
Class for specifying a binary size, with units
public class ByteCapacity : IEquatable<ByteCapacity>
- Inheritance
-
ByteCapacity
- Implements
- Inherited Members
Constructors
ByteCapacity(long)
public ByteCapacity(long bytes)
Parameters
byteslong
Methods
B(long)
Specify an amount in bytes
public static ByteCapacity B(long bytes)
Parameters
byteslongThe size, in bytes
Returns
Equals(ByteCapacity?)
Returns a value indicating whether this instance is equal to a specified ByteCapacity value.
public bool Equals(ByteCapacity? obj)
Parameters
objByteCapacityAn object to compare with this instance.
Returns
- bool
true if obj has the same value as this instance; otherwise, false.
Equals(object?)
Returns a value indicating whether this instance is equal to a specified ByteCapacity value.
public override bool Equals(object? obj)
Parameters
objobjectAn object to compare with this instance.
Returns
- bool
true if obj is an instance of ByteCapacityand equals the value of this instance; otherwise, false.
Gb(long)
Specify an amount, in gigabytes
public static ByteCapacity Gb(long gigabytes)
Parameters
gigabyteslongThe size, in gigabytes
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
Kb(long)
Specify an amount, in kilobytes
public static ByteCapacity Kb(long kilobytes)
Parameters
kilobyteslongThe size, in kilobytes
Returns
Mb(long)
Specify an amount, in megabytes
public static ByteCapacity Mb(long megabytes)
Parameters
megabyteslongThe size, in megabytes
Returns
Parse(string)
Parse a string into a ByteCapacity
public static ByteCapacity Parse(string value)
Parameters
valuestringThe value, as string
Returns
Tb(long)
Specify an amount, in terabytes
public static ByteCapacity Tb(long terabytes)
Parameters
terabyteslongThe size, in terabytes
Returns
Operators
explicit operator ByteCapacity(string)
Explicitly convert a string into a ByteCapacity
public static explicit operator ByteCapacity(string value)
Parameters
valuestringThe value, as string
Returns
implicit operator long(ByteCapacity)
Cast a ByteCapacity into a long
public static implicit operator long(ByteCapacity value)
Parameters
valueByteCapacityThe value
Returns
- long
The total number of bytes.