C# Class DarkMapleLib.Helpers.ArrayWriter

Class to handle writing data to an byte array
Exibir arquivo Open project: enguard/Ecalia

Private Properties

Property Type Description
EnsureCapacity void

Public Methods

Method Description
ArrayWriter ( int initialBufferSize = 0x50 ) : System

Creates a new instance of a ArrayWriter

SetBool ( bool value, int position ) : void

Sets a bool in the buffer

SetByte ( byte value, int position ) : void

Sets a unsigned byte in the buffer

SetBytes ( byte bytes, int position ) : void

Sets bytes in the buffer

SetInt ( int value, int position ) : void

Sets a signed int in the buffer

SetLong ( long value, int position ) : void

Sets a signed long in the buffer

SetSByte ( sbyte value, int position ) : void

Sets a signed byte in the buffer

SetShort ( short value, int position ) : void

Sets a signed short in the buffer

SetUInt ( uint value, int position ) : void

Sets a unsigned int in the buffer

SetULong ( ulong value, int position ) : void

Sets a unsigned long in the buffer

SetUShort ( ushort value, int position ) : void

Sets a unsigned short in the buffer

ToArray ( bool direct = false ) : byte[]

Creates an byte array of the current ArrayWriter

WriteBool ( bool value ) : void

Writes a bool to the buffer

WriteByte ( byte value ) : void

Writes a unsigned byte to the buffer

WriteBytes ( byte bytes ) : void

Writes bytes to the buffer

WriteInt ( int value ) : void

Writes a signed int to the buffer

WriteLong ( long value ) : void

Writes a signed long to the buffer

WriteMapleString ( string mString ) : void

Write a string as maplestring to the buffer

WriteSByte ( sbyte value ) : void

Writes a signed byte to the buffer

WriteShort ( short value ) : void

Writes a signed short to the buffer

WriteUInt ( uint value ) : void

Writes a unsigned int to the buffer

WriteULong ( ulong value ) : void

Writes a unsigned long to the buffer

WriteUShort ( ushort value ) : void

Writes a unsigned short to the buffer

WriteZeroBytes ( int count ) : void

Writes a number of empty bytes to the buffer

Private Methods

Method Description
EnsureCapacity ( int length ) : void

Prevents the buffer being to small

Method Details

ArrayWriter() public method

Creates a new instance of a ArrayWriter
public ArrayWriter ( int initialBufferSize = 0x50 ) : System
initialBufferSize int Sets the initial size of the buffer
return System

SetBool() public method

Sets a bool in the buffer
public SetBool ( bool value, int position ) : void
value bool
position int
return void

SetByte() public method

Sets a unsigned byte in the buffer
public SetByte ( byte value, int position ) : void
value byte
position int
return void

SetBytes() public method

Sets bytes in the buffer
public SetBytes ( byte bytes, int position ) : void
bytes byte
position int
return void

SetInt() public method

Sets a signed int in the buffer
public SetInt ( int value, int position ) : void
value int
position int
return void

SetLong() public method

Sets a signed long in the buffer
public SetLong ( long value, int position ) : void
value long
position int
return void

SetSByte() public method

Sets a signed byte in the buffer
public SetSByte ( sbyte value, int position ) : void
value sbyte
position int
return void

SetShort() public method

Sets a signed short in the buffer
public SetShort ( short value, int position ) : void
value short
position int
return void

SetUInt() public method

Sets a unsigned int in the buffer
public SetUInt ( uint value, int position ) : void
value uint
position int
return void

SetULong() public method

Sets a unsigned long in the buffer
public SetULong ( ulong value, int position ) : void
value ulong
position int
return void

SetUShort() public method

Sets a unsigned short in the buffer
public SetUShort ( ushort value, int position ) : void
value ushort
position int
return void

ToArray() public method

Creates an byte array of the current ArrayWriter
public ToArray ( bool direct = false ) : byte[]
direct bool If true, returns a direct reference of the buffer
return byte[]

WriteBool() public method

Writes a bool to the buffer
public WriteBool ( bool value ) : void
value bool
return void

WriteByte() public method

Writes a unsigned byte to the buffer
public WriteByte ( byte value ) : void
value byte
return void

WriteBytes() public method

Writes bytes to the buffer
public WriteBytes ( byte bytes ) : void
bytes byte
return void

WriteInt() public method

Writes a signed int to the buffer
public WriteInt ( int value ) : void
value int
return void

WriteLong() public method

Writes a signed long to the buffer
public WriteLong ( long value ) : void
value long
return void

WriteMapleString() public method

Write a string as maplestring to the buffer
public WriteMapleString ( string mString ) : void
mString string String to write
return void

WriteSByte() public method

Writes a signed byte to the buffer
public WriteSByte ( sbyte value ) : void
value sbyte
return void

WriteShort() public method

Writes a signed short to the buffer
public WriteShort ( short value ) : void
value short
return void

WriteUInt() public method

Writes a unsigned int to the buffer
public WriteUInt ( uint value ) : void
value uint
return void

WriteULong() public method

Writes a unsigned long to the buffer
public WriteULong ( ulong value ) : void
value ulong
return void

WriteUShort() public method

Writes a unsigned short to the buffer
public WriteUShort ( ushort value ) : void
value ushort
return void

WriteZeroBytes() public method

Writes a number of empty bytes to the buffer
public WriteZeroBytes ( int count ) : void
count int Number of empty (zero) bytes to write
return void