C# 클래스 SwfDotNet.IO.Utils.EndianBitConverter

Equivalent of System.BitConverter, but with either endianness.
파일 보기 프로젝트 열기: bladecoding/SwfExport 1 사용 예제들

공개 메소드들

메소드 설명
CopyBytes ( bool value, byte buffer, int index ) : void

Copies the specified Boolean value into the specified byte array, beginning at the specified index.

CopyBytes ( char value, byte buffer, int index ) : void

Copies the specified Unicode character value into the specified byte array, beginning at the specified index.

CopyBytes ( decimal value, byte buffer, int index ) : void

Copies the specified decimal value into the specified byte array, beginning at the specified index.

CopyBytes ( double value, byte buffer, int index ) : void

Copies the specified double-precision floating point value into the specified byte array, beginning at the specified index.

CopyBytes ( float value, byte buffer, int index ) : void

Copies the specified single-precision floating point value into the specified byte array, beginning at the specified index.

CopyBytes ( int value, byte buffer, int index ) : void

Copies the specified 32-bit signed integer value into the specified byte array, beginning at the specified index.

CopyBytes ( long value, byte buffer, int index ) : void

Copies the specified 64-bit signed integer value into the specified byte array, beginning at the specified index.

CopyBytes ( short value, byte buffer, int index ) : void

Copies the specified 16-bit signed integer value into the specified byte array, beginning at the specified index.

CopyBytes ( uint value, byte buffer, int index ) : void

Copies the specified 32-bit unsigned integer value into the specified byte array, beginning at the specified index.

CopyBytes ( ulong value, byte buffer, int index ) : void

Copies the specified 64-bit unsigned integer value into the specified byte array, beginning at the specified index.

CopyBytes ( ushort value, byte buffer, int index ) : void

Copies the specified 16-bit unsigned integer value into the specified byte array, beginning at the specified index.

DoubleToInt64Bits ( double value ) : long

Converts the specified double-precision floating point number to a 64-bit signed integer. Note: the endianness of this converter does not affect the returned value.

GetBytes ( bool value ) : byte[]

Returns the specified Boolean value as an array of bytes.

GetBytes ( char value ) : byte[]

Returns the specified Unicode character value as an array of bytes.

GetBytes ( decimal value ) : byte[]

Returns the specified decimal value as an array of bytes.

GetBytes ( double value ) : byte[]

Returns the specified double-precision floating point value as an array of bytes.

GetBytes ( float value ) : byte[]

Returns the specified single-precision floating point value as an array of bytes.

GetBytes ( int value ) : byte[]

Returns the specified 32-bit signed integer value as an array of bytes.

GetBytes ( long value ) : byte[]

Returns the specified 64-bit signed integer value as an array of bytes.

GetBytes ( short value ) : byte[]

Returns the specified 16-bit signed integer value as an array of bytes.

GetBytes ( uint value ) : byte[]

Returns the specified 32-bit unsigned integer value as an array of bytes.

GetBytes ( ulong value ) : byte[]

Returns the specified 64-bit unsigned integer value as an array of bytes.

GetBytes ( ushort value ) : byte[]

Returns the specified 16-bit unsigned integer value as an array of bytes.

Int32BitsToSingle ( int value ) : float

Converts the specified 32-bit signed integer to a single-precision floating point number. Note: the endianness of this converter does not affect the returned value.

Int64BitsToDouble ( long value ) : double

Converts the specified 64-bit signed integer to a double-precision floating point number. Note: the endianness of this converter does not affect the returned value.

IsLittleEndian ( ) : bool

Indicates the byte order ("endianess") in which data is converted using this class.

Different computer architectures store data using different byte orders. "Big-endian" means the most significant byte is on the left end of a word. "Little-endian" means the most significant byte is on the right end of a word.

SingleToInt32Bits ( float value ) : int

Converts the specified single-precision floating point number to a 32-bit signed integer. Note: the endianness of this converter does not affect the returned value.

ToBoolean ( byte value, int startIndex ) : bool

Returns a Boolean value converted from one byte at a specified position in a byte array.

ToChar ( byte value, int startIndex ) : char

Returns a Unicode character converted from two bytes at a specified position in a byte array.

ToDecimal ( byte value, int startIndex ) : decimal

Returns a decimal value converted from sixteen bytes at a specified position in a byte array.

ToDouble ( byte value, int startIndex ) : double

Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.

ToInt16 ( byte value, int startIndex ) : short

Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.

ToInt32 ( byte value, int startIndex ) : int

Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.

ToInt64 ( byte value, int startIndex ) : long

Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.

ToSingle ( byte value, int startIndex ) : float

Returns a single-precision floating point number converted from four bytes at a specified position in a byte array.

ToString ( byte value ) : string

Returns a String converted from the elements of a byte array.

All the elements of value are converted.

ToString ( byte value, int startIndex ) : string

Returns a String converted from the elements of a byte array starting at a specified array position.

The elements from array position startIndex to the end of the array are converted.

ToString ( byte value, int startIndex, int length ) : string

Returns a String converted from a specified number of bytes at a specified position in a byte array.

The length elements from array position startIndex are converted.

ToUInt16 ( byte value, int startIndex ) : ushort

Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.

ToUInt32 ( byte value, int startIndex ) : uint

Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.

ToUInt64 ( byte value, int startIndex ) : ulong

Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.

보호된 메소드들

메소드 설명
CopyBytesImpl ( long value, int bytes, byte buffer, int index ) : void

Copies the given number of bytes from the least-specific end of the specified value into the specified byte array, beginning at the specified index. This must be implemented in concrete derived classes, but the implementation may assume that the value will fit into the buffer.

FromBytes ( byte value, int startIndex, int bytesToConvert ) : long

Convert the given number of bytes from the given array, from the given start position, into a long, using the bytes as the least significant part of the long. By the time this is called, the arguments have been checked for validity.

비공개 메소드들

메소드 설명
CheckByteArgument ( byte value, int startIndex, int bytesRequired ) : void

Checks the given argument for validity.

CheckedFromBytes ( byte value, int startIndex, int bytesToConvert ) : long

Checks the arguments for validity before calling FromBytes (which can therefore assume the arguments are valid).

CopyBytes ( long value, int bytes, byte buffer, int index ) : void

Copies the given number of bytes from the least-specific end of the specified value into the specified byte array, beginning at the specified index. This is used to implement the other CopyBytes methods.

GetBytes ( long value, int bytes ) : byte[]

Returns an array with the given number of bytes formed from the least significant bytes of the specified value. This is used to implement the other GetBytes methods.

메소드 상세

CopyBytes() 공개 메소드

Copies the specified Boolean value into the specified byte array, beginning at the specified index.
public CopyBytes ( bool value, byte buffer, int index ) : void
value bool A Boolean value.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified Unicode character value into the specified byte array, beginning at the specified index.
public CopyBytes ( char value, byte buffer, int index ) : void
value char A character to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified decimal value into the specified byte array, beginning at the specified index.
public CopyBytes ( decimal value, byte buffer, int index ) : void
value decimal A character to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified double-precision floating point value into the specified byte array, beginning at the specified index.
public CopyBytes ( double value, byte buffer, int index ) : void
value double The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified single-precision floating point value into the specified byte array, beginning at the specified index.
public CopyBytes ( float value, byte buffer, int index ) : void
value float The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 32-bit signed integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( int value, byte buffer, int index ) : void
value int The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 64-bit signed integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( long value, byte buffer, int index ) : void
value long The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 16-bit signed integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( short value, byte buffer, int index ) : void
value short The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 32-bit unsigned integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( uint value, byte buffer, int index ) : void
value uint The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 64-bit unsigned integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( ulong value, byte buffer, int index ) : void
value ulong The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytes() 공개 메소드

Copies the specified 16-bit unsigned integer value into the specified byte array, beginning at the specified index.
public CopyBytes ( ushort value, byte buffer, int index ) : void
value ushort The number to convert.
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

CopyBytesImpl() 보호된 추상적인 메소드

Copies the given number of bytes from the least-specific end of the specified value into the specified byte array, beginning at the specified index. This must be implemented in concrete derived classes, but the implementation may assume that the value will fit into the buffer.
protected abstract CopyBytesImpl ( long value, int bytes, byte buffer, int index ) : void
value long The value to copy bytes for
bytes int The number of significant bytes to copy
buffer byte The byte array to copy the bytes into
index int The first index into the array to copy the bytes into
리턴 void

DoubleToInt64Bits() 공개 메소드

Converts the specified double-precision floating point number to a 64-bit signed integer. Note: the endianness of this converter does not affect the returned value.
public DoubleToInt64Bits ( double value ) : long
value double The number to convert.
리턴 long

FromBytes() 보호된 추상적인 메소드

Convert the given number of bytes from the given array, from the given start position, into a long, using the bytes as the least significant part of the long. By the time this is called, the arguments have been checked for validity.
protected abstract FromBytes ( byte value, int startIndex, int bytesToConvert ) : long
value byte The bytes to convert
startIndex int The index of the first byte to convert
bytesToConvert int The number of bytes to use in the conversion
리턴 long

GetBytes() 공개 메소드

Returns the specified Boolean value as an array of bytes.
public GetBytes ( bool value ) : byte[]
value bool A Boolean value.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified Unicode character value as an array of bytes.
public GetBytes ( char value ) : byte[]
value char A character to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified decimal value as an array of bytes.
public GetBytes ( decimal value ) : byte[]
value decimal The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified double-precision floating point value as an array of bytes.
public GetBytes ( double value ) : byte[]
value double The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified single-precision floating point value as an array of bytes.
public GetBytes ( float value ) : byte[]
value float The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 32-bit signed integer value as an array of bytes.
public GetBytes ( int value ) : byte[]
value int The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 64-bit signed integer value as an array of bytes.
public GetBytes ( long value ) : byte[]
value long The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 16-bit signed integer value as an array of bytes.
public GetBytes ( short value ) : byte[]
value short The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 32-bit unsigned integer value as an array of bytes.
public GetBytes ( uint value ) : byte[]
value uint The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 64-bit unsigned integer value as an array of bytes.
public GetBytes ( ulong value ) : byte[]
value ulong The number to convert.
리턴 byte[]

GetBytes() 공개 메소드

Returns the specified 16-bit unsigned integer value as an array of bytes.
public GetBytes ( ushort value ) : byte[]
value ushort The number to convert.
리턴 byte[]

Int32BitsToSingle() 공개 메소드

Converts the specified 32-bit signed integer to a single-precision floating point number. Note: the endianness of this converter does not affect the returned value.
public Int32BitsToSingle ( int value ) : float
value int The number to convert.
리턴 float

Int64BitsToDouble() 공개 메소드

Converts the specified 64-bit signed integer to a double-precision floating point number. Note: the endianness of this converter does not affect the returned value.
public Int64BitsToDouble ( long value ) : double
value long The number to convert.
리턴 double

IsLittleEndian() 공개 추상적인 메소드

Indicates the byte order ("endianess") in which data is converted using this class.
Different computer architectures store data using different byte orders. "Big-endian" means the most significant byte is on the left end of a word. "Little-endian" means the most significant byte is on the right end of a word.
public abstract IsLittleEndian ( ) : bool
리턴 bool

SingleToInt32Bits() 공개 메소드

Converts the specified single-precision floating point number to a 32-bit signed integer. Note: the endianness of this converter does not affect the returned value.
public SingleToInt32Bits ( float value ) : int
value float The number to convert.
리턴 int

ToBoolean() 공개 메소드

Returns a Boolean value converted from one byte at a specified position in a byte array.
public ToBoolean ( byte value, int startIndex ) : bool
value byte An array of bytes.
startIndex int The starting position within value.
리턴 bool

ToChar() 공개 메소드

Returns a Unicode character converted from two bytes at a specified position in a byte array.
public ToChar ( byte value, int startIndex ) : char
value byte An array of bytes.
startIndex int The starting position within value.
리턴 char

ToDecimal() 공개 메소드

Returns a decimal value converted from sixteen bytes at a specified position in a byte array.
public ToDecimal ( byte value, int startIndex ) : decimal
value byte An array of bytes.
startIndex int The starting position within value.
리턴 decimal

ToDouble() 공개 메소드

Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.
public ToDouble ( byte value, int startIndex ) : double
value byte An array of bytes.
startIndex int The starting position within value.
리턴 double

ToInt16() 공개 메소드

Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
public ToInt16 ( byte value, int startIndex ) : short
value byte An array of bytes.
startIndex int The starting position within value.
리턴 short

ToInt32() 공개 메소드

Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
public ToInt32 ( byte value, int startIndex ) : int
value byte An array of bytes.
startIndex int The starting position within value.
리턴 int

ToInt64() 공개 메소드

Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
public ToInt64 ( byte value, int startIndex ) : long
value byte An array of bytes.
startIndex int The starting position within value.
리턴 long

ToSingle() 공개 메소드

Returns a single-precision floating point number converted from four bytes at a specified position in a byte array.
public ToSingle ( byte value, int startIndex ) : float
value byte An array of bytes.
startIndex int The starting position within value.
리턴 float

ToString() 공개 정적인 메소드

Returns a String converted from the elements of a byte array.
All the elements of value are converted.
public static ToString ( byte value ) : string
value byte An array of bytes.
리턴 string

ToString() 공개 정적인 메소드

Returns a String converted from the elements of a byte array starting at a specified array position.
The elements from array position startIndex to the end of the array are converted.
public static ToString ( byte value, int startIndex ) : string
value byte An array of bytes.
startIndex int The starting position within value.
리턴 string

ToString() 공개 정적인 메소드

Returns a String converted from a specified number of bytes at a specified position in a byte array.
The length elements from array position startIndex are converted.
public static ToString ( byte value, int startIndex, int length ) : string
value byte An array of bytes.
startIndex int The starting position within value.
length int The number of bytes to convert.
리턴 string

ToUInt16() 공개 메소드

Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.
public ToUInt16 ( byte value, int startIndex ) : ushort
value byte An array of bytes.
startIndex int The starting position within value.
리턴 ushort

ToUInt32() 공개 메소드

Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.
public ToUInt32 ( byte value, int startIndex ) : uint
value byte An array of bytes.
startIndex int The starting position within value.
리턴 uint

ToUInt64() 공개 메소드

Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.
public ToUInt64 ( byte value, int startIndex ) : ulong
value byte An array of bytes.
startIndex int The starting position within value.
리턴 ulong