coastline 0.0.4
Loading...
Searching...
No Matches
NetStream Class Reference

A stream of the bytes and bits of a packet, read and written from the most significant bit. More...

#include <netstream.h>

Public Member Functions

 NetStream ()
 An empty stream of its own bytes.
void StreamAttachBuffer (unsigned char *pData, int nSize)
 Read the bytes of a buffer from their start.
void StreamResetReadWrite ()
 Empty the stream.
void StreamResetRead ()
 Read the stream again from its start.
void StreamSkip (int nCount)
 Skip bytes, from the next whole byte.
unsigned char StreamReadByte ()
 Read a byte, from the next whole byte.
unsigned StreamReadInt16 ()
 Read two bytes as an unsigned number, from the next whole byte.
unsigned StreamReadInt24 ()
 Read three bytes as an unsigned number, from the next whole byte.
int StreamReadInt32 ()
 Read four bytes as a number, from the next whole byte.
unsigned BitStreamReadBits (int nBits)
 Read bits as an unsigned number.
bool StreamIsAtEnd ()
 Whether the reading arrived at the end of the data written.
void StreamWriteByte (unsigned char bValue)
 Write a byte, from the next whole byte.
void StreamWriteInt16 (unsigned nValue)
 Write the low two bytes of a number, from the next whole byte.
void StreamWriteInt24 (unsigned nValue)
 Write the low three bytes of a number, from the next whole byte.
void StreamWriteInt32 (unsigned nValue)
 Write the four bytes of a number, from the next whole byte.
void BitStreamWriteBits (unsigned nValue, int nBits)
 Write the low bits of a number.
int StreamGetWriteSize ()
 The number of bytes written, counting a byte partly written.
unsigned char * StreamGetBufferPtr ()
 The bytes of the stream.

Detailed Description

A stream of the bytes and bits of a packet, read and written from the most significant bit.

Constructor & Destructor Documentation

◆ NetStream()

NetStream::NetStream ( )

An empty stream of its own bytes.

Ghidra address:
BRD3D: 0x10073b40
Ghidra address:
BRGlide: 0x1006cd80

Member Function Documentation

◆ StreamAttachBuffer()

void NetStream::StreamAttachBuffer ( unsigned char * pData,
int nSize )

Read the bytes of a buffer from their start.

Parameters
pDataThe buffer.
nSizeThe number of bytes.
Ghidra address:
BRD3D: 0x10073b60
Ghidra address:
BRGlide: 0x1006cda0

◆ StreamResetReadWrite()

void NetStream::StreamResetReadWrite ( )

Empty the stream.

Ghidra address:
BRD3D: 0x10073b80
Ghidra address:
BRGlide: 0x1006cdc0

◆ StreamResetRead()

void NetStream::StreamResetRead ( )

Read the stream again from its start.

Ghidra address:
BRD3D: 0x10073b90
Ghidra address:
BRGlide: 0x1006cdd0

◆ StreamSkip()

void NetStream::StreamSkip ( int nCount)

Skip bytes, from the next whole byte.

Parameters
nCountThe number of bytes.
Ghidra address:
BRD3D: 0x10073ba0
Ghidra address:
BRGlide: 0x1006cde0

◆ StreamReadByte()

unsigned char NetStream::StreamReadByte ( )

Read a byte, from the next whole byte.

Returns
The byte.
Ghidra address:
BRD3D: 0x10073bc0
Ghidra address:
BRGlide: 0x1006ce00

◆ StreamReadInt16()

unsigned NetStream::StreamReadInt16 ( )

Read two bytes as an unsigned number, from the next whole byte.

Returns
The number.
Ghidra address:
BRD3D: 0x10073be0
Ghidra address:
BRGlide: 0x1006ce20

◆ StreamReadInt24()

unsigned NetStream::StreamReadInt24 ( )

Read three bytes as an unsigned number, from the next whole byte.

Returns
The number.
Ghidra address:
BRD3D: 0x10073c10
Ghidra address:
BRGlide: 0x1006ce50

◆ StreamReadInt32()

int NetStream::StreamReadInt32 ( )

Read four bytes as a number, from the next whole byte.

Returns
The number.
Ghidra address:
BRD3D: 0x10073c40
Ghidra address:
BRGlide: 0x1006ce80

◆ BitStreamReadBits()

unsigned NetStream::BitStreamReadBits ( int nBits)

Read bits as an unsigned number.

Parameters
nBitsThe number of bits.
Returns
The number.
Ghidra address:
BRD3D: 0x10073c90
Ghidra address:
BRGlide: 0x1006ced0

◆ StreamIsAtEnd()

bool NetStream::StreamIsAtEnd ( )

Whether the reading arrived at the end of the data written.

Returns
Whether it arrived.
Ghidra address:
BRD3D: 0x10073d40
Ghidra address:
BRGlide: 0x1006cf80

◆ StreamWriteByte()

void NetStream::StreamWriteByte ( unsigned char bValue)

Write a byte, from the next whole byte.

Parameters
bValueThe byte.
Ghidra address:
BRD3D: 0x10073d60
Ghidra address:
BRGlide: 0x1006cfa0

◆ StreamWriteInt16()

void NetStream::StreamWriteInt16 ( unsigned nValue)

Write the low two bytes of a number, from the next whole byte.

Parameters
nValueThe number.
Ghidra address:
BRD3D: 0x10073d80
Ghidra address:
BRGlide: 0x1006cfc0

◆ StreamWriteInt24()

void NetStream::StreamWriteInt24 ( unsigned nValue)

Write the low three bytes of a number, from the next whole byte.

Parameters
nValueThe number.
Ghidra address:
BRD3D: 0x10073dc0
Ghidra address:
BRGlide: 0x1006d000

◆ StreamWriteInt32()

void NetStream::StreamWriteInt32 ( unsigned nValue)

Write the four bytes of a number, from the next whole byte.

Parameters
nValueThe number.
Ghidra address:
BRD3D: 0x10073e10
Ghidra address:
BRGlide: 0x1006d050

◆ BitStreamWriteBits()

void NetStream::BitStreamWriteBits ( unsigned nValue,
int nBits )

Write the low bits of a number.

Parameters
nValueThe number.
nBitsThe number of bits.
Ghidra address:
BRD3D: 0x10073e70
Ghidra address:
BRGlide: 0x1006d0b0

◆ StreamGetWriteSize()

int NetStream::StreamGetWriteSize ( )

The number of bytes written, counting a byte partly written.

Returns
The number of bytes.
Ghidra address:
BRD3D: 0x10073f40
Ghidra address:
BRGlide: 0x1006d180

◆ StreamGetBufferPtr()

unsigned char * NetStream::StreamGetBufferPtr ( )

The bytes of the stream.

Returns
pBuffer.
Ghidra address:
BRD3D: 0x10073f50
Ghidra address:
BRGlide: 0x1006d190

The documentation for this class was generated from the following file: