C# 클래스 Avalon.Utility.Stream.PacketWriter

Provides functionality for writing primitive binary data.
파일 보기 프로젝트 열기: mabinogidev/mabinogi-development 1 사용 예제들

공개 메소드들

메소드 설명
CreateInstance ( ) : PacketWriter
CreateInstance ( int capacity, bool fixedsize ) : 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 Big Endian 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 Big Endian 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.

메소드 상세

CreateInstance() 공개 정적인 메소드

public static CreateInstance ( ) : PacketWriter
리턴 PacketWriter

CreateInstance() 공개 정적인 메소드

public static CreateInstance ( int capacity, bool fixedsize ) : PacketWriter
capacity int
fixedsize bool
리턴 PacketWriter

Fill() 공개 메소드

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

Fill() 공개 메소드

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

PacketWriter() 공개 메소드

Instantiates a new PacketWriter instance with the default capacity of 4 bytes.
public PacketWriter ( ) : System
리턴 System

PacketWriter() 공개 메소드

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

ReleaseInstance() 공개 정적인 메소드

public static ReleaseInstance ( PacketWriter pw ) : void
pw PacketWriter
리턴 void

Seek() 공개 메소드

Offsets the current position from an origin.
public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
리턴 long

ToArray() 공개 메소드

Gets the entire stream content as a byte array.
public ToArray ( ) : byte[]
리턴 byte[]

Write() 공개 메소드

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
리턴 void

Write() 공개 메소드

Writes a 1-byte unsigned integer value to the underlying stream.
public Write ( byte value ) : void
value byte
리턴 void

Write() 공개 메소드

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

Write() 공개 메소드

Writes a 4-byte Big Endian signed integer value to the underlying stream.
public Write ( int value ) : void
value int
리턴 void

Write() 공개 메소드

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

Write() 공개 메소드

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

Write() 공개 메소드

Writes a 4-byte Big Endian unsigned integer value to the underlying stream.
public Write ( uint value ) : void
value uint
리턴 void

Write() 공개 메소드

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

WriteAsciiFixed() 공개 메소드

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
리턴 void

WriteAsciiNull() 공개 메소드

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
리턴 void

WriteBigUniFixed() 공개 메소드

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
리턴 void

WriteBigUniNull() 공개 메소드

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
리턴 void

WriteLittleUniFixed() 공개 메소드

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
리턴 void

WriteLittleUniNull() 공개 메소드

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
리턴 void