Detailed Description

Manages loading binary data from an SPA file.

Inheritance diagram for Spa.SPAReader:

Public Member Functions

 SPAReader (Stream stream)
 Creates a new reader for the given stream. More...
 
 SPAReader (byte[] src)
 Creates a new reader for the given block of bytes. More...
 
void ResetCoordinates ()
 Resets the map coordinates. Used only when an SPA actually has a map. More...
 
override string ReadString ()
 Reads a string from the stream; it has no length limit. More...
 
string ReadString (int length)
 Reads a string with the given length from the stream. More...
 
uint ReadUInt24 ()
 Reads a 3 byte unsigned integer from the stream. More...
 
int ReadInt24 ()
 Reads a 3 byte integer from the stream. More...
 
ulong ReadCompressed ()
 Reads a compressed integer - the opposite of Writer.WriteCompressed. More...
 
long ReadCompressedSigned ()
 Reads a signed compressed number. More...
 

Static Public Member Functions

static int CompressedSize (ulong l)
 How many bytes the given value would create if written out. More...
 

Public Attributes

int PreviousX
 The previously read map X coordinate. Used for compression purposes. More...
 
int PreviousY
 The previously read map Y coordinate. Used for compression purposes. More...
 

Static Public Attributes

static readonly Encoding TextEncoding =Encoding.UTF8
 The text encoding in use. More...
 

Constructor & Destructor Documentation

Spa.SPAReader.SPAReader ( Stream  stream)
inline

Creates a new reader for the given stream.

Parameters
streamA stream to read from.
Spa.SPAReader.SPAReader ( byte[]  src)
inline

Creates a new reader for the given block of bytes.

Parameters
srcThe source block of bytes to read from.

Member Function Documentation

static int Spa.SPAReader.CompressedSize ( ulong  l)
inlinestatic

How many bytes the given value would create if written out.

ulong Spa.SPAReader.ReadCompressed ( )
inline

Reads a compressed integer - the opposite of Writer.WriteCompressed.

long Spa.SPAReader.ReadCompressedSigned ( )
inline

Reads a signed compressed number.

int Spa.SPAReader.ReadInt24 ( )
inline

Reads a 3 byte integer from the stream.

Returns
A 3 byte integer.
override string Spa.SPAReader.ReadString ( )
inline

Reads a string from the stream; it has no length limit.

Returns
The string that was read.
string Spa.SPAReader.ReadString ( int  length)
inline

Reads a string with the given length from the stream.

Parameters
lengthThe length of the string.
Returns
The string read from the stream.
uint Spa.SPAReader.ReadUInt24 ( )
inline

Reads a 3 byte unsigned integer from the stream.

Returns
A 3 byte unsigned integer.
void Spa.SPAReader.ResetCoordinates ( )
inline

Resets the map coordinates. Used only when an SPA actually has a map.

Member Data Documentation

int Spa.SPAReader.PreviousX

The previously read map X coordinate. Used for compression purposes.

int Spa.SPAReader.PreviousY

The previously read map Y coordinate. Used for compression purposes.

readonly Encoding Spa.SPAReader.TextEncoding =Encoding.UTF8
static

The text encoding in use.