C# 클래스 fCraft.BufferUtil

Provides utility methods for working with byte arrays and pointers.
파일 보기 프로젝트 열기: fragmer/fCraft 1 사용 예제들

공개 메소드들

메소드 설명
MemCpy ( [ src, [ dest, int len ) : void

Copies contents of src buffer to dest buffer, as efficiently as possible.

MemSet ( [ array, byte value ) : void

Fills the entire given byte array with a specified byte value, as efficiently as possible.

MemSet ( [ array, byte value, int startIndex, int length ) : void

Fills a section of the given byte array with a specified byte value, as efficiently as possible.

ReadAll ( [ source, [ destination ) : void

Reads a number of bytes from source that matches the length of destination byte array.

WriteAll ( [ source, [ destination ) : void

Writes contents of given byte array to a stream, in chunks of at most 512 MiB. Works around an overflow in BufferedStream.Write(byte[]) that happens on 1 GiB+ writes.

비공개 메소드들

메소드 설명
MemCmp ( [ data, int offset, [ value ) : bool

메소드 상세

MemCpy() 공개 정적인 메소드

Copies contents of src buffer to dest buffer, as efficiently as possible.
public static MemCpy ( [ src, [ dest, int len ) : void
src [ Source array/pointer.
dest [ Destination array/pointer.
len int Number of bytes to copy.
리턴 void

MemSet() 공개 정적인 메소드

Fills the entire given byte array with a specified byte value, as efficiently as possible.
array is null.
public static MemSet ( [ array, byte value ) : void
array [ Array to work with.
value byte Value to assign to each byte of the array.
리턴 void

MemSet() 공개 정적인 메소드

Fills a section of the given byte array with a specified byte value, as efficiently as possible.
array is null. length is negative; startIndex is negative; /// or if (length+startIndex) is greater than array length.
public static MemSet ( [ array, byte value, int startIndex, int length ) : void
array [ Array to work with.
value byte Value to assign to each byte of the array.
startIndex int Index of the first byte that should be set.
length int Number of bytes of the array to set.
리턴 void

ReadAll() 공개 정적인 메소드

Reads a number of bytes from source that matches the length of destination byte array.
source or destination is null. The end of stream is reached before destination array was filled.
public static ReadAll ( [ source, [ destination ) : void
source [ Stream to read from.
destination [ Byte array to write to. Length of this array is used.
리턴 void

WriteAll() 공개 정적인 메소드

Writes contents of given byte array to a stream, in chunks of at most 512 MiB. Works around an overflow in BufferedStream.Write(byte[]) that happens on 1 GiB+ writes.
source or destination is null.
public static WriteAll ( [ source, [ destination ) : void
source [ Byte array to read from. Must not be null.
destination [ Stream to write to. Must not be null.
리턴 void