C# Class Server.Network.PacketWriter

Provides functionality for writing primitive binary data.
Afficher le fichier Open project: Grimoric/RunUO.T2A Class Usage Examples

Méthodes publiques

Méthode Description
CreateInstance ( ) : PacketWriter
CreateInstance ( int capacity ) : PacketWriter
Fill ( ) : void

Fills the stream from the current position up to (capacity) with 0x00's

Fill ( int length ) : void

Writes a number of 0x00 byte values to the underlying stream.

PacketWriter ( ) : System

Instantiates a new PacketWriter instance with the default capacity of 4 bytes.

PacketWriter ( int capacity ) : System

Instantiates a new PacketWriter instance with a given capacity.

ReleaseInstance ( PacketWriter pw ) : void
Seek ( long offset, SeekOrigin origin ) : long

Offsets the current position from an origin.

ToArray ( ) : byte[]

Gets the entire stream content as a byte array.

Write ( bool value ) : void

Writes a 1-byte boolean value to the underlying stream. False is represented by 0, true by 1.

Write ( byte value ) : void

Writes a 1-byte unsigned integer value to the underlying stream.

Write ( byte buffer, int offset, int size ) : void

Writes a sequence of bytes to the underlying stream

Write ( int value ) : void

Writes a 4-byte signed integer value to the underlying stream.

Write ( sbyte value ) : void

Writes a 1-byte signed integer value to the underlying stream.

Write ( short value ) : void

Writes a 2-byte signed integer value to the underlying stream.

Write ( uint value ) : void

Writes a 4-byte unsigned integer value to the underlying stream.

Write ( ushort value ) : void

Writes a 2-byte unsigned integer value to the underlying stream.

WriteAsciiFixed ( string value, int size ) : void

Writes a fixed-length ASCII-encoded string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.

WriteAsciiNull ( string value ) : void

Writes a dynamic-length ASCII-encoded string value to the underlying stream, followed by a 1-byte null character.

WriteBigUniFixed ( string value, int size ) : void

Writes a fixed-length big-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.

WriteBigUniNull ( string value ) : void

Writes a dynamic-length big-endian unicode string value to the underlying stream, followed by a 2-byte null character.

WriteLittleUniFixed ( string value, int size ) : void

Writes a fixed-length little-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.

WriteLittleUniNull ( string value ) : void

Writes a dynamic-length little-endian unicode string value to the underlying stream, followed by a 2-byte null character.

Method Details

CreateInstance() public static méthode

public static CreateInstance ( ) : PacketWriter
Résultat PacketWriter

CreateInstance() public static méthode

public static CreateInstance ( int capacity ) : PacketWriter
capacity int
Résultat PacketWriter

Fill() public méthode

Fills the stream from the current position up to (capacity) with 0x00's
public Fill ( ) : void
Résultat void

Fill() public méthode

Writes a number of 0x00 byte values to the underlying stream.
public Fill ( int length ) : void
length int
Résultat void

PacketWriter() public méthode

Instantiates a new PacketWriter instance with the default capacity of 4 bytes.
public PacketWriter ( ) : System
Résultat System

PacketWriter() public méthode

Instantiates a new PacketWriter instance with a given capacity.
public PacketWriter ( int capacity ) : System
capacity int Initial capacity for the internal stream.
Résultat System

ReleaseInstance() public static méthode

public static ReleaseInstance ( PacketWriter pw ) : void
pw PacketWriter
Résultat void

Seek() public méthode

Offsets the current position from an origin.
public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
Résultat long

ToArray() public méthode

Gets the entire stream content as a byte array.
public ToArray ( ) : byte[]
Résultat byte[]

Write() public méthode

Writes a 1-byte boolean value to the underlying stream. False is represented by 0, true by 1.
public Write ( bool value ) : void
value bool
Résultat void

Write() public méthode

Writes a 1-byte unsigned integer value to the underlying stream.
public Write ( byte value ) : void
value byte
Résultat void

Write() public méthode

Writes a sequence of bytes to the underlying stream
public Write ( byte buffer, int offset, int size ) : void
buffer byte
offset int
size int
Résultat void

Write() public méthode

Writes a 4-byte signed integer value to the underlying stream.
public Write ( int value ) : void
value int
Résultat void

Write() public méthode

Writes a 1-byte signed integer value to the underlying stream.
public Write ( sbyte value ) : void
value sbyte
Résultat void

Write() public méthode

Writes a 2-byte signed integer value to the underlying stream.
public Write ( short value ) : void
value short
Résultat void

Write() public méthode

Writes a 4-byte unsigned integer value to the underlying stream.
public Write ( uint value ) : void
value uint
Résultat void

Write() public méthode

Writes a 2-byte unsigned integer value to the underlying stream.
public Write ( ushort value ) : void
value ushort
Résultat void

WriteAsciiFixed() public méthode

Writes a fixed-length ASCII-encoded string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.
public WriteAsciiFixed ( string value, int size ) : void
value string
size int
Résultat void

WriteAsciiNull() public méthode

Writes a dynamic-length ASCII-encoded string value to the underlying stream, followed by a 1-byte null character.
public WriteAsciiNull ( string value ) : void
value string
Résultat void

WriteBigUniFixed() public méthode

Writes a fixed-length big-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.
public WriteBigUniFixed ( string value, int size ) : void
value string
size int
Résultat void

WriteBigUniNull() public méthode

Writes a dynamic-length big-endian unicode string value to the underlying stream, followed by a 2-byte null character.
public WriteBigUniNull ( string value ) : void
value string
Résultat void

WriteLittleUniFixed() public méthode

Writes a fixed-length little-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.
public WriteLittleUniFixed ( string value, int size ) : void
value string
size int
Résultat void

WriteLittleUniNull() public méthode

Writes a dynamic-length little-endian unicode string value to the underlying stream, followed by a 2-byte null character.
public WriteLittleUniNull ( string value ) : void
value string
Résultat void