C# 클래스 GonzoNet.PacketStream

A readable and writable packet.
상속: Stream
파일 보기 프로젝트 열기: RHY3756547/FreeSO 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
m_VariableLength bool

보호된 프로퍼티들

프로퍼티 타입 설명
m_BaseStream System.IO.MemoryStream
m_Length int
m_Reader System.IO.BinaryReader

공개 메소드들

메소드 설명
Flush ( ) : void

Flushes the underlying stream.

PacketStream ( byte ID, int Length ) : System

Constructs a new PacketStream instance to write to.

PacketStream ( byte ID, int Length, byte DataBuffer ) : System

Constructs a new PacketStream instance to read from.

PeekByte ( ) : byte

Peeks a byte from the stream at the current position.

PeekByte ( int Position ) : byte

Peeks a byte from the stream at the specified position.

PeekInt ( int Position ) : int

Peeks an int from the stream at the specified position.

PeekUShort ( int Position ) : ushort

Peeks a ushort from the stream at the specified position.

Read ( byte buffer, int offset, int count ) : int

Reads a specific number of bytes from this PacketStream.

ReadByte ( ) : int

Reads a byte from this PacketStream instance.

ReadBytes ( int NumBytes ) : byte[]

Reads a specific number of bytes from this PacketStream.

ReadDouble ( ) : double

Reads a double from this PacketStream instance.

ReadInt32 ( ) : int

Reads an integer from this PacketStream instance.

ReadInt64 ( ) : long

Reads a long integer from this PacketStream instance.

ReadString ( ) : string

Reads a string from this PacketStream instance.

ReadString ( int NumChars ) : string

Reads a string from this PacketStream instance.

ReadUInt16 ( ) : ushort

Reads a short from this PacketStream instance.

ReadUInt64 ( ) : ulong

Reads an unsigned long integer from this PacketStream instance.

ReadUShort ( ) : ushort

Reads a ushort from this PacketStream instance.

Seek ( long offset, SeekOrigin origin ) : long

Do not call this! It will throw a NotImplementedException!

SetLength ( long value ) : void

Sets the length of this PacketStream to the specified value.

ToArray ( ) : byte[]

Creates an array of bytes with the data in this PacketStream instance.

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

Writes a block of bytes to this PacketStream instance.

WriteByte ( byte Value ) : void

Writes a byte to this PacketStream instance.

WriteBytes ( byte Buffer ) : void

Writes a block of bytes to this PacketStream instance.

WriteDouble ( double Value ) : void

Writes a 64 bit double to this PacketStream instance.

WriteHeader ( ) : void

Writes the packet header.

WriteInt32 ( int Value ) : void

Writes a 32 bit integer to this PacketStream instance.

WriteInt64 ( long Value ) : void

Writes a 64 bit integer to this PacketStream instance.

WriteString ( string Str ) : void
WriteUInt16 ( ushort Value ) : void

Writes an unsigned short to this PacketStream instance.

WriteUInt64 ( ulong Value ) : void

Writes an unsigned 64 bit integer to this PacketStream instance.

메소드 상세

Flush() 공개 메소드

Flushes the underlying stream.
public Flush ( ) : void
리턴 void

PacketStream() 공개 메소드

Constructs a new PacketStream instance to write to.
public PacketStream ( byte ID, int Length ) : System
ID byte The ID of this PacketStream instance.
Length int The length of this PacketStream instance (0 if variable length).
리턴 System

PacketStream() 공개 메소드

Constructs a new PacketStream instance to read from.
public PacketStream ( byte ID, int Length, byte DataBuffer ) : System
ID byte The ID of this PacketStream instance.
Length int The length of this PacketStream instance.
DataBuffer byte The buffer from which to create this PacketStream instance.
리턴 System

PeekByte() 공개 메소드

Peeks a byte from the stream at the current position.
public PeekByte ( ) : byte
리턴 byte

PeekByte() 공개 메소드

Peeks a byte from the stream at the specified position.
public PeekByte ( int Position ) : byte
Position int The position to peek at.
리턴 byte

PeekInt() 공개 메소드

Peeks an int from the stream at the specified position.
public PeekInt ( int Position ) : int
Position int The position to peek at.
리턴 int

PeekUShort() 공개 메소드

Peeks a ushort from the stream at the specified position.
public PeekUShort ( int Position ) : ushort
Position int The position to peek at.
리턴 ushort

Read() 공개 메소드

Reads a specific number of bytes from this PacketStream.
public Read ( byte buffer, int offset, int count ) : int
buffer byte The buffer to read into.
offset int The zero-based byte offset in buffer at which to begin storing data from the current stream.
count int The number of bytes to read (must be at least equal to the length of buffer!)
리턴 int

ReadByte() 공개 메소드

Reads a byte from this PacketStream instance.
public ReadByte ( ) : int
리턴 int

ReadBytes() 공개 메소드

Reads a specific number of bytes from this PacketStream.
public ReadBytes ( int NumBytes ) : byte[]
NumBytes int Number of bytes to read.
리턴 byte[]

ReadDouble() 공개 메소드

Reads a double from this PacketStream instance.
public ReadDouble ( ) : double
리턴 double

ReadInt32() 공개 메소드

Reads an integer from this PacketStream instance.
public ReadInt32 ( ) : int
리턴 int

ReadInt64() 공개 메소드

Reads a long integer from this PacketStream instance.
public ReadInt64 ( ) : long
리턴 long

ReadString() 공개 메소드

Reads a string from this PacketStream instance.
public ReadString ( ) : string
리턴 string

ReadString() 공개 메소드

Reads a string from this PacketStream instance.
public ReadString ( int NumChars ) : string
NumChars int
리턴 string

ReadUInt16() 공개 메소드

Reads a short from this PacketStream instance.
public ReadUInt16 ( ) : ushort
리턴 ushort

ReadUInt64() 공개 메소드

Reads an unsigned long integer from this PacketStream instance.
public ReadUInt64 ( ) : ulong
리턴 ulong

ReadUShort() 공개 메소드

Reads a ushort from this PacketStream instance.
public ReadUShort ( ) : ushort
리턴 ushort

Seek() 공개 메소드

Do not call this! It will throw a NotImplementedException!
public Seek ( long offset, SeekOrigin origin ) : long
offset long The offset to seek to.
origin SeekOrigin The origin of the seek.
리턴 long

SetLength() 공개 메소드

Sets the length of this PacketStream to the specified value.
public SetLength ( long value ) : void
value long The length of the stream.
리턴 void

ToArray() 공개 메소드

Creates an array of bytes with the data in this PacketStream instance.
public ToArray ( ) : byte[]
리턴 byte[]

Write() 공개 메소드

Writes a block of bytes to this PacketStream instance.
public Write ( byte buffer, int offset, int count ) : void
buffer byte The data to write.
offset int The offset at which to start writing.
count int The maximum number of bytes to write.
리턴 void

WriteByte() 공개 메소드

Writes a byte to this PacketStream instance.
public WriteByte ( byte Value ) : void
Value byte The byte to write.
리턴 void

WriteBytes() 공개 메소드

Writes a block of bytes to this PacketStream instance.
public WriteBytes ( byte Buffer ) : void
Buffer byte The data to write.
리턴 void

WriteDouble() 공개 메소드

Writes a 64 bit double to this PacketStream instance.
public WriteDouble ( double Value ) : void
Value double The 64 bit double to write.
리턴 void

WriteHeader() 공개 메소드

Writes the packet header.
public WriteHeader ( ) : void
리턴 void

WriteInt32() 공개 메소드

Writes a 32 bit integer to this PacketStream instance.
public WriteInt32 ( int Value ) : void
Value int The 32 bit integer to write.
리턴 void

WriteInt64() 공개 메소드

Writes a 64 bit integer to this PacketStream instance.
public WriteInt64 ( long Value ) : void
Value long The 64 bit integer to write.
리턴 void

WriteString() 공개 메소드

public WriteString ( string Str ) : void
Str string
리턴 void

WriteUInt16() 공개 메소드

Writes an unsigned short to this PacketStream instance.
public WriteUInt16 ( ushort Value ) : void
Value ushort The unsigned short to write.
리턴 void

WriteUInt64() 공개 메소드

Writes an unsigned 64 bit integer to this PacketStream instance.
public WriteUInt64 ( ulong Value ) : void
Value ulong The unsigned 64 bit integer to write.
리턴 void

프로퍼티 상세

m_BaseStream 보호되어 있는 프로퍼티

protected MemoryStream,System.IO m_BaseStream
리턴 System.IO.MemoryStream

m_Length 보호되어 있는 프로퍼티

protected int m_Length
리턴 int

m_Reader 보호되어 있는 프로퍼티

protected BinaryReader,System.IO m_Reader
리턴 System.IO.BinaryReader

m_VariableLength 공개적으로 프로퍼티

public bool m_VariableLength
리턴 bool