C# 클래스 Utilities.Binary.Extensions.ByteExtensions

파일 보기 프로젝트 열기: feanz/Utilities

공개 메소드들

메소드 설명
Append ( this data, byte toAppend ) : byte[]

Appends the specified data to the source byte array

Base64ToByteArray ( this Input ) : byte[]

Converts base 64 string to a byte array

BinaryToByteArray ( this binary ) : byte[]

Convert binary string representation to byte array

BinaryToDecimal ( this text ) : string

Returns the decimal representation of a binary number.

BinaryToHex ( this text ) : string

Returns the hexadecimal representation of a binary number.

Compress ( this data, CompressionType compressionType = CompressionType.Deflate ) : byte[]

Compresses the data using the specified compression type

Compress ( this data, Encoding encodingUsing = null, CompressionType compressionType = CompressionType.Deflate ) : string

Compresses a string of data

DecimalToBinary ( this txt ) : string

Returns the binary representation of a binary number.

DecimalToHex ( this txt ) : string

Returns the hexadecimal representation of a decimal number.

Decompress ( this data, CompressionType CompressionType = CompressionType.Deflate ) : byte[]

Decompresses the byte array that is sent in

Decompress ( this data, Encoding EncodingUsing = null, CompressionType CompressionType = CompressionType.Deflate ) : string

Decompresses a string of data

HexToBinary ( this hex ) : string

Returns the binary representation of a hexadecimal number.

HexToByteArray ( this hex ) : byte[]

Converts a hexadecimal string to a byte array representation.

The string is assumed to be of even size.

HexToDecimal ( this hex ) : string

Returns the decimal representation of a hexadecimal number.

IsBinary ( this binary ) : bool

Validate if string is a valide binary representation

IsHex ( this hex ) : bool

Validate is string is a valide hex representation

IsUnicode ( this data ) : bool

Determines if a byte array is unicode

ToBase64String ( this data ) : string

Converts a byte array into a base 64 string

ToBinary ( this data ) : string

Convert byte array to a binary representation as a string

ToByteArray ( this input, Encoding encodingUsing = null ) : byte[]

Converts a string to a byte array

ToEncodedString ( this data, Encoding encodingUsing = null, int index, int count = -1 ) : string

Converts a byte array to a string

ToHex ( this data ) : string

Converts a byte array to a hexadecimal string representation.

ToHexNibble ( this data ) : byte

Convert byte to nibble (4 bit value)

ToInt32 ( this data ) : int

Convert byte array to a 32 bit int

ToNibbleString ( this data ) : string

Convert a byte array into a string with each byte represented as nibbles

비공개 메소드들

메소드 설명
GetStream ( MemoryStream Stream, CompressionMode Mode, CompressionType CompressionType ) : Stream

메소드 상세

Append() 공개 정적인 메소드

Appends the specified data to the source byte array
public static Append ( this data, byte toAppend ) : byte[]
data this Byte array to be appended
toAppend byte Byte array to append.
리턴 byte[]

Base64ToByteArray() 공개 정적인 메소드

Converts base 64 string to a byte array
public static Base64ToByteArray ( this Input ) : byte[]
Input this Input string
리턴 byte[]

BinaryToByteArray() 공개 정적인 메소드

Convert binary string representation to byte array
public static BinaryToByteArray ( this binary ) : byte[]
binary this Binary string
리턴 byte[]

BinaryToDecimal() 공개 정적인 메소드

Returns the decimal representation of a binary number.
public static BinaryToDecimal ( this text ) : string
text this Binary string to convert to decimal.
리턴 string

BinaryToHex() 공개 정적인 메소드

Returns the hexadecimal representation of a binary number.
public static BinaryToHex ( this text ) : string
text this Binary string to convert to hexadecimal.
리턴 string

Compress() 공개 정적인 메소드

Compresses the data using the specified compression type
public static Compress ( this data, CompressionType compressionType = CompressionType.Deflate ) : byte[]
data this data to compress
compressionType CompressionType Compression type
리턴 byte[]

Compress() 공개 정적인 메소드

Compresses a string of data
public static Compress ( this data, Encoding encodingUsing = null, CompressionType compressionType = CompressionType.Deflate ) : string
data this data to Compress
encodingUsing System.Text.Encoding Encoding that the data uses (defaults to UTF8)
compressionType CompressionType The compression type used
리턴 string

DecimalToBinary() 공개 정적인 메소드

Returns the binary representation of a binary number.
public static DecimalToBinary ( this txt ) : string
txt this Decimal string to convert to binary.
리턴 string

DecimalToHex() 공개 정적인 메소드

Returns the hexadecimal representation of a decimal number.
public static DecimalToHex ( this txt ) : string
txt this Hexadecimal string to convert to decimal.
리턴 string

Decompress() 공개 정적인 메소드

Decompresses the byte array that is sent in
public static Decompress ( this data, CompressionType CompressionType = CompressionType.Deflate ) : byte[]
data this data to decompress
CompressionType CompressionType The compression type used
리턴 byte[]

Decompress() 공개 정적인 메소드

Decompresses a string of data
public static Decompress ( this data, Encoding EncodingUsing = null, CompressionType CompressionType = CompressionType.Deflate ) : string
data this data to decompress
EncodingUsing System.Text.Encoding Encoding that the result should use (defaults to UTF8)
CompressionType CompressionType The compression type used
리턴 string

HexToBinary() 공개 정적인 메소드

Returns the binary representation of a hexadecimal number.
public static HexToBinary ( this hex ) : string
hex this Binary string to convert to hexadecimal.
리턴 string

HexToByteArray() 공개 정적인 메소드

Converts a hexadecimal string to a byte array representation.
The string is assumed to be of even size.
public static HexToByteArray ( this hex ) : byte[]
hex this Hexadecimal string to convert to byte array.
리턴 byte[]

HexToDecimal() 공개 정적인 메소드

Returns the decimal representation of a hexadecimal number.
public static HexToDecimal ( this hex ) : string
hex this Hexadecimal string to convert to decimal.
리턴 string

IsBinary() 공개 정적인 메소드

Validate if string is a valide binary representation
public static IsBinary ( this binary ) : bool
binary this
리턴 bool

IsHex() 공개 정적인 메소드

Validate is string is a valide hex representation
public static IsHex ( this hex ) : bool
hex this
리턴 bool

IsUnicode() 공개 정적인 메소드

Determines if a byte array is unicode
public static IsUnicode ( this data ) : bool
data this Input array
리턴 bool

ToBase64String() 공개 정적인 메소드

Converts a byte array into a base 64 string
public static ToBase64String ( this data ) : string
data this Input array
리턴 string

ToBinary() 공개 정적인 메소드

Convert byte array to a binary representation as a string
public static ToBinary ( this data ) : string
data this The byte array to be converted to a string
리턴 string

ToByteArray() 공개 정적인 메소드

Converts a string to a byte array
public static ToByteArray ( this input, Encoding encodingUsing = null ) : byte[]
input this input string
encodingUsing System.Text.Encoding The type of encoding the string is using (defaults to UTF8)
리턴 byte[]

ToEncodedString() 공개 정적인 메소드

Converts a byte array to a string
public static ToEncodedString ( this data, Encoding encodingUsing = null, int index, int count = -1 ) : string
data this input array
encodingUsing System.Text.Encoding The type of encoding the string is using (defaults to UTF8)
index int The index of the first byte to decode
count int /// Number of bytes starting at the index to convert (use -1 for the entire array starting at the /// index) ///
리턴 string

ToHex() 공개 정적인 메소드

Converts a byte array to a hexadecimal string representation.
public static ToHex ( this data ) : string
data this Byte array to convert to hexadecimal string.
리턴 string

ToHexNibble() 공개 정적인 메소드

Convert byte to nibble (4 bit value)
public static ToHexNibble ( this data ) : byte
data this the byte to be converted to a nibble
리턴 byte

ToInt32() 공개 정적인 메소드

Convert byte array to a 32 bit int
public static ToInt32 ( this data ) : int
data this The byte array to be converted
리턴 int

ToNibbleString() 공개 정적인 메소드

Convert a byte array into a string with each byte represented as nibbles
public static ToNibbleString ( this data ) : string
data this The byte array to be converted to a string of nibbles
리턴 string