Table of Contents

Class ByteUnit

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Represents a unit of measurement for bytes and is used with measurement of data.

public sealed class ByteUnit : PrefixUnit, IPrefixUnit, IUnit, IEquatable<IUnit>
Inheritance
Object
ByteUnit
Implements
IEquatable<IUnit>
Inherited Members

Constructors

ByteUnit(Double, IPrefixMultiple, Action<UnitFormatOptions>)

Initializes a new instance of the ByteUnit struct.

public ByteUnit(double value, IPrefixMultiple prefix, Action<UnitFormatOptions> setup = null)

Parameters

value Double

The value of this unit expressed as bytes.

prefix IPrefixMultiple

The prefix to associate with this unit.

setup Action<UnitFormatOptions>

The UnitFormatOptions which may be configured.

Exceptions

ArgumentOutOfRangeException

value is lower than 0 -or- prefix is less than a metric-multiple Kilo.

Fields

BitsPerByte

Defines how many bits is needed for one byte.

public const int BitsPerByte = 8

Field Value

Int32

BitsPerNibble

Defines how many bits is needed for one nibble (one hexadecimal digit).

public const int BitsPerNibble = 4

Field Value

Int32

Name

Defines the name of a byte unit.

public const string Name = "byte"

Field Value

String

Symbol

Defines the symbol of a byte unit.

public const string Symbol = "B"

Field Value

String

Operators

Implicit(ByteUnit to Double)

Performs an implicit conversion from ByteUnit to System.Double.

public static implicit operator double (ByteUnit unit)

Parameters

unit ByteUnit

The ByteUnit to convert.

Returns

Double

A System.Double that is equivalent to unit.

See Also