Manages loading binary data from an SPA file.
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... | |
|
inline |
Creates a new reader for the given stream.
stream | A stream to read from. |
|
inline |
Creates a new reader for the given block of bytes.
src | The source block of bytes to read from. |
|
inlinestatic |
How many bytes the given value would create if written out.
|
inline |
Reads a compressed integer - the opposite of Writer.WriteCompressed.
|
inline |
Reads a signed compressed number.
|
inline |
Reads a 3 byte integer from the stream.
|
inline |
Reads a string from the stream; it has no length limit.
|
inline |
Reads a string with the given length from the stream.
length | The length of the string. |
|
inline |
Reads a 3 byte unsigned integer from the stream.
|
inline |
Resets the map coordinates. Used only when an SPA actually has a map.
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.
|
static |
The text encoding in use.