Table of Contents

Class BinaryRepresentationExtensions

Namespace
Garyon.Extensions
Assembly
Garyon.dll

Provides extensions for the binary representation of values.

public static class BinaryRepresentationExtensions
Inheritance
BinaryRepresentationExtensions
Inherited Members

Methods

GetBinaryRepresentation(byte, int)

Gets the binary representation of the byte value.

public static string GetBinaryRepresentation(this byte value, int totalBits = 8)

Parameters

value byte

The value.

totalBits int

The total bits to display. Defaults to the number of bits a byte value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(short, int)

Gets the binary representation of the short value.

public static string GetBinaryRepresentation(this short value, int totalBits = 16)

Parameters

value short

The value.

totalBits int

The total bits to display. Defaults to the number of bits a short value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(int, int)

Gets the binary representation of the int value.

public static string GetBinaryRepresentation(this int value, int totalBits = 32)

Parameters

value int

The value.

totalBits int

The total bits to display. Defaults to the number of bits an int value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(long, int)

Gets the binary representation of the long value.

public static string GetBinaryRepresentation(this long value, int totalBits = 64)

Parameters

value long

The value.

totalBits int

The total bits to display. Defaults to the number of bits a long value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(sbyte, int)

Gets the binary representation of the sbyte value.

public static string GetBinaryRepresentation(this sbyte value, int totalBits = 8)

Parameters

value sbyte

The value.

totalBits int

The total bits to display. Defaults to the number of bits a sbyte value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(ushort, int)

Gets the binary representation of the ushort value.

public static string GetBinaryRepresentation(this ushort value, int totalBits = 16)

Parameters

value ushort

The value.

totalBits int

The total bits to display. Defaults to the number of bits a ushort value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(uint, int)

Gets the binary representation of the uint value.

public static string GetBinaryRepresentation(this uint value, int totalBits = 32)

Parameters

value uint

The value.

totalBits int

The total bits to display. Defaults to the number of bits a uint value contains.

Returns

string

The binary representation of the value.

GetBinaryRepresentation(ulong, int)

Gets the binary representation of the ulong value.

public static string GetBinaryRepresentation(this ulong value, int totalBits = 64)

Parameters

value ulong

The value.

totalBits int

The total bits to display. Defaults to the number of bits a ulong value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(byte, int, int)

Gets the binary representation of the byte value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this byte value, int groupLength, int totalBits = 8)

Parameters

value byte

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a byte value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(short, int, int)

Gets the binary representation of the short value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this short value, int groupLength, int totalBits = 16)

Parameters

value short

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a short value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(int, int, int)

Gets the binary representation of the int value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this int value, int groupLength, int totalBits = 32)

Parameters

value int

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a int value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(long, int, int)

Gets the binary representation of the long value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this long value, int groupLength, int totalBits = 64)

Parameters

value long

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a long value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(sbyte, int, int)

Gets the binary representation of the sbyte value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this sbyte value, int groupLength, int totalBits = 8)

Parameters

value sbyte

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a sbyte value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(ushort, int, int)

Gets the binary representation of the ushort value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this ushort value, int groupLength, int totalBits = 16)

Parameters

value ushort

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a ushort value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(uint, int, int)

Gets the binary representation of the uint value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this uint value, int groupLength, int totalBits = 32)

Parameters

value uint

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a uint value contains.

Returns

string

The binary representation of the value.

GetGroupedBinaryRepresentation(ulong, int, int)

Gets the binary representation of the ulong value, while also grouping the digits.

public static string GetGroupedBinaryRepresentation(this ulong value, int groupLength, int totalBits = 64)

Parameters

value ulong

The value.

groupLength int

The length of each digit group in the resulting binary representation. Must be non-negative. If 0, no grouping is performed.

totalBits int

The total bits to display. Defaults to the number of bits a ulong value contains.

Returns

string

The binary representation of the value.