Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
InfiniteBitStream Class Reference

`#include <bitStream.h>`

Inheritance diagram for InfiniteBitStream:

## Public Member Functions
| InfiniteBitStream ()
| ~InfiniteBitStream ()
void | validate (U32 upcomingBytes)
| Ensure we have space for at least upcomingBytes more bytes in the stream. More...
void | reset ()
| Reset the stream to zero length (but don't clean memory). More...
void | compact ()
| Shrink the buffer down to match the actual size of the data. More...
void | writeToStream (Stream &s)
| Write us out to a stream... Results in last byte getting padded! More...
virtual void | writeBits (S32 bitCount, const void *bitPtr)
virtual bool | writeFlag (bool val)
const U32 | getCRC ()
Public Member Functions inherited from ResizeBitStream
| ResizeBitStream (U32 minSpace=1500, U32 initialSize=0)
void | validate ()
| ~ResizeBitStream ()
Public Member Functions inherited from BitStream
void | setBuffer (void *bufPtr, S32 bufSize, S32 maxSize=0)
U8 * | getBuffer ()
U8 * | getBytePtr ()
U32 | getReadByteSize ()
S32 | getCurPos () const
void | setCurPos (const U32)
| BitStream (void *bufPtr, S32 bufSize, S32 maxWriteSize=-1)
void | clear ()
void | setStringBuffer (char buffer[256])
void | writeInt (S32 value, S32 bitCount)
S32 | readInt (S32 bitCount)
void | writeCussedU32 (U32 val)
U32 | readCussedU32 ()
void | writeSignedInt (S32 value, S32 bitCount)
S32 | readSignedInt (S32 bitCount)
void | writeRangedU32 (U32 value, U32 rangeStart, U32 rangeEnd)
U32 | readRangedU32 (U32 rangeStart, U32 rangeEnd)
void | writeRangedS32 (S32 value, S32 min, S32 max)
S32 | readRangedS32 (S32 min, S32 max)
| Reads a ranged signed integer written with writeRangedS32. More...
F32 | readFloat (S32 bitCount)
F32 | readSignedFloat (S32 bitCount)
void | writeFloat (F32 f, S32 bitCount)
void | writeSignedFloat (F32 f, S32 bitCount)
void | writeRangedF32 (F32 value, F32 min, F32 max, U32 numBits)
F32 | readRangedF32 (F32 min, F32 max, U32 numBits)
| Reads a ranged floating point value written with writeRangedF32. More...
void | writeClassId (U32 classId, U32 classType, U32 classGroup)
S32 | readClassId (U32 classType, U32 classGroup)
void | writeNormalVector (const Point3F &vec, S32 bitCount)
void | readNormalVector (Point3F *vec, S32 bitCount)
void | clearCompressionPoint ()
void | setCompressionPoint (const Point3F &p)
void | writeCompressedPoint (const Point3F &p, F32 scale=0.01f)
void | readCompressedPoint (Point3F *p, F32 scale=0.01f)
void | writeNormalVector (const Point3F &vec, S32 angleBitCount, S32 zBitCount)
void | readNormalVector (Point3F *vec, S32 angleBitCount, S32 zBitCount)
void | readVector (Point3F *vec, F32 minMag, F32 maxMag, S32 magBits, S32 angleBits, S32 zBits)
void | writeVector (Point3F vec, F32 minMag, F32 maxMag, S32 magBits, S32 angleBits, S32 zBits)
void | writeAffineTransform (const MatrixF &)
void | readAffineTransform (MatrixF *)
virtual void | readBits (S32 bitCount, void *bitPtr)
virtual bool | readFlag ()
void | setBit (S32 bitCount, bool set)
bool | testBit (S32 bitCount)
bool | isFull ()
bool | isValid ()
bool | _read (const U32 size, void *d)
bool | _write (const U32 size, const void *d)
void | readString (char stringBuf[256])
| Reads a string of maximum 255 characters long. More...
void | writeString (const char *stringBuf, S32 maxLen=255)
| Writes a string to the stream. More...
bool | hasCapability (const Capability) const
| Checks to see if this stream has the capability of a given function. More...
U32 | getPosition () const
| Gets the position in the stream. More...
bool | setPosition (const U32 in_newPosition)
| Sets the position of the stream. Returns if the new position is valid or not. More...
U32 | getStreamSize ()
| Gets the size of the stream. More...
Public Member Functions inherited from Stream
| Stream ()
virtual | ~Stream ()
Stream::Status | getStatus () const
| Gets the status of the stream. More...
void | readLine (U8 *buffer, U32 bufferSize)
void | writeLine (U8 *buffer)
| writes a line to the stream More...
const char * | readSTString (bool casesens=false)
void | readLongString (U32 maxStringLen, char *stringBuf)
void | writeLongString (U32 maxStringLen, const char *string)
bool | Put (char character)
bool | writeFormattedBuffer (const char *format,...)
bool | writeStringBuffer (const char *buffer)
| Writes a NULL terminated string buffer. More...
bool | write (const ColorI &)
| Write an integral color to the stream. More...
bool | write (const ColorF &)
| Write a floating point color to the stream. More...
bool | read (ColorI *)
| Read an integral color from the stream. More...
bool | read (ColorF *)
| Read a floating point color from the stream. More...
bool | read (const U32 in_numBytes, void *out_pBuffer)
bool | write (const U32 in_numBytes, const void *in_pBuffer)
bool | read (bool *out_pRead)
bool | write (const bool &in_rWrite)
bool | copyFrom (Stream *other)
| Copy the contents of another stream into this one. More...
void | writeTabs (U32 count)
| Write a number of tabs to this stream. More...

## Additional Inherited Members
Public Types inherited from Stream
enum | Status { Ok = 0, IOError, EOS, IllegalCall, Closed, UnknownError }
| Status constantants for the stream. More...
enum | Capability { StreamWrite = BIT(0), StreamRead = BIT(1), StreamPosition = BIT(2) }
Static Public Member Functions inherited from BitStream
static BitStream * | getPacketStream (U32 writeSize=0)
static void | sendPacketStream (const NetAddress *addr)
static Point3F | dumbDownNormal (const Point3F &vec, S32 bitCount)
Static Public Member Functions inherited from Stream
static const char * | getStatusString (const Status in_status)
| Gets a printable string form of the status. More...
Protected Member Functions inherited from Stream
void | setStatus (const Status in_newStatus)
Protected Attributes inherited from ResizeBitStream
U32 | mMinSpace
Protected Attributes inherited from BitStream
U8 * | dataPtr
S32 | bitNum
S32 | bufSize
bool | error
S32 | maxReadBitNum
S32 | maxWriteBitNum
char * | stringBuffer
bool | mCompressRelative
Point3F | mCompressPoint

## Detailed Description

This class acts to provide an "infinitely extending" stream.

Basically, it does what ResizeBitStream does, but it validates on every write op, so that you never have to worry about overwriting the buffer.

## Constructor & Destructor Documentation

InfiniteBitStream | ( |  | ) |

~InfiniteBitStream | ( |  | ) |

## Member Function Documentation

void compact | ( |  | ) |

Shrink the buffer down to match the actual size of the data.

const U32 getCRC | ( |  | ) |
| inline

void reset | ( |  | ) |

Reset the stream to zero length (but don't clean memory).

void validate | ( | U32 | upcomingBytes | ) |

Ensure we have space for at least upcomingBytes more bytes in the stream.

virtual void writeBits | ( | S32 | bitCount,
|  | const void * | bitPtr
| ) |  |
| inline virtual

Reimplemented from BitStream.

virtual bool writeFlag | ( | bool | val | ) |
| inline virtual

Reimplemented from BitStream.

void writeToStream | ( | Stream & | s | ) |

Write us out to a stream... Results in last byte getting padded!

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

- io/bitStream.h
- io/bitStream.cc