Class ByteUnit
Represents a unit of measurement for bytes and is used with measurement of data.
Inherited Members
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public sealed class ByteUnit : PrefixUnit, IPrefixUnit, IUnit, IEquatable<IUnit>
Constructors
| Improve this Doc View SourceByteUnit(Double, IPrefixMultiple, Action<UnitFormatOptions>)
Initializes a new instance of the ByteUnit struct.
Declaration
public ByteUnit(double value, IPrefixMultiple prefix, Action<UnitFormatOptions> setup = null)
Parameters
Type | Name | Description |
---|---|---|
Double | value | The value of this unit expressed as bytes. |
IPrefixMultiple | prefix | The prefix to associate with this unit. |
Action<UnitFormatOptions> | setup | The UnitFormatOptions which may be configured. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Fields
| Improve this Doc View SourceBitsPerByte
Defines how many bits is needed for one byte.
Declaration
public const int BitsPerByte = 8
Field Value
Type | Description |
---|---|
Int32 |
BitsPerNibble
Defines how many bits is needed for one nibble (one hexadecimal digit).
Declaration
public const int BitsPerNibble = 4
Field Value
Type | Description |
---|---|
Int32 |
Name
Defines the name of a byte unit.
Declaration
public const string Name = "byte"
Field Value
Type | Description |
---|---|
String |
Symbol
Defines the symbol of a byte unit.
Declaration
public const string Symbol = "B"
Field Value
Type | Description |
---|---|
String |
Operators
| Improve this Doc View SourceImplicit(ByteUnit to Double)
Declaration
public static implicit operator double (ByteUnit unit)
Parameters
Type | Name | Description |
---|---|---|
ByteUnit | unit | The ByteUnit to convert. |
Returns
Type | Description |
---|---|
Double | A Double that is equivalent to |