C# 클래스 Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrr.MarshalHelper

This class is used to marshal simple types.
파일 보기 프로젝트 열기: Microsoft/WindowsProtocolTestSuites 1 사용 예제들

공개 메소드들

메소드 설명
ByteArrayToString ( byte buffer ) : string

Transfer a byte array to a binary string.

GetBytes ( System.DateTime value, bool isBigEndian ) : byte[]

convert DateTime to bytes, the encoding is the seconds from 19700101

GetBytes ( byte buffer, int &index, int count ) : byte[]

get bytes from bytes

GetBytes ( uint value, bool isBigEndian ) : byte[]

convert value to bytes

GetBytes ( ushort value, bool isBigEndian ) : byte[]

convert value to bytes

GetDateTime ( byte buffer, int &index, bool isBigEndian ) : System.DateTime

Get UInt32 data from buffer, and transfer it to DateTime

GetUInt16 ( byte buffer, int &index, bool isBigEndian ) : ushort

parse UInt16 from bytes

GetUInt32 ( byte buffer, int &index, bool isBigEndian ) : uint

parse UInt32 from bytes

GetUInt64 ( byte buffer, int &index, bool isBigEndian ) : ulong

parse UInt64 from bytes

ReverseByFlag ( bool isBigEndian, byte ret ) : void

reverse the bytes if it's not big endian.

메소드 상세

ByteArrayToString() 공개 정적인 메소드

Transfer a byte array to a binary string.
public static ByteArrayToString ( byte buffer ) : string
buffer byte The input byte array
리턴 string

GetBytes() 공개 정적인 메소드

convert DateTime to bytes, the encoding is the seconds from 19700101
public static GetBytes ( System.DateTime value, bool isBigEndian ) : byte[]
value System.DateTime a DateTime value
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 byte[]

GetBytes() 공개 정적인 메소드

get bytes from bytes
public static GetBytes ( byte buffer, int &index, int count ) : byte[]
buffer byte the buffer stores the value.
index int the index of start to parse
count int count of bytes
리턴 byte[]

GetBytes() 공개 정적인 메소드

convert value to bytes
public static GetBytes ( uint value, bool isBigEndian ) : byte[]
value uint a UInt32 value
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 byte[]

GetBytes() 공개 정적인 메소드

convert value to bytes
public static GetBytes ( ushort value, bool isBigEndian ) : byte[]
value ushort a UInt16 value
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 byte[]

GetDateTime() 공개 정적인 메소드

Get UInt32 data from buffer, and transfer it to DateTime
public static GetDateTime ( byte buffer, int &index, bool isBigEndian ) : System.DateTime
buffer byte the buffer stores the value.
index int the index of start to parse
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 System.DateTime

GetUInt16() 공개 정적인 메소드

parse UInt16 from bytes
public static GetUInt16 ( byte buffer, int &index, bool isBigEndian ) : ushort
buffer byte the buffer stores the value.
index int the index of start to parse
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 ushort

GetUInt32() 공개 정적인 메소드

parse UInt32 from bytes
public static GetUInt32 ( byte buffer, int &index, bool isBigEndian ) : uint
buffer byte the buffer stores the value.
index int the index of start to parse
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 uint

GetUInt64() 공개 정적인 메소드

parse UInt64 from bytes
public static GetUInt64 ( byte buffer, int &index, bool isBigEndian ) : ulong
buffer byte the buffer stores the value.
index int the index of start to parse
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
리턴 ulong

ReverseByFlag() 공개 정적인 메소드

reverse the bytes if it's not big endian.
public static ReverseByFlag ( bool isBigEndian, byte ret ) : void
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
ret byte the bytes will be re-order
리턴 void