Show / Hide Table of Contents

Class ByteUnit

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

Inheritance
Object
PrefixUnit
ByteUnit
Implements
IPrefixUnit
IUnit
IEquatable<IUnit>
Inherited Members
PrefixUnit.UnitName
PrefixUnit.UnitSymbol
PrefixUnit.UnitValue
PrefixUnit.Prefix
PrefixUnit.PrefixValue
PrefixUnit.Equals(IUnit)
PrefixUnit.ToString()
PrefixUnit.ToString(Action<UnitFormatOptions>)
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public sealed class ByteUnit : PrefixUnit, IPrefixUnit, IUnit, IEquatable<IUnit>

Constructors

| Improve this Doc View Source

ByteUnit(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

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

Fields

| Improve this Doc View Source

BitsPerByte

Defines how many bits is needed for one byte.

Declaration
public const int BitsPerByte = 8
Field Value
Type Description
Int32
| Improve this Doc View Source

BitsPerNibble

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

Declaration
public const int BitsPerNibble = 4
Field Value
Type Description
Int32
| Improve this Doc View Source

Name

Defines the name of a byte unit.

Declaration
public const string Name = "byte"
Field Value
Type Description
String
| Improve this Doc View Source

Symbol

Defines the symbol of a byte unit.

Declaration
public const string Symbol = "B"
Field Value
Type Description
String

Operators

| Improve this Doc View Source

Implicit(ByteUnit to Double)

Performs an implicit conversion from 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 unit.

Implements

IPrefixUnit
IUnit
System.IEquatable<T>

See Also

PrefixUnit
BitUnit
BinaryPrefix
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX