Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Stream Class Reference

Functions for opening streams, as well as functions for reading and writing data. More...

Public Member Functions

stream FromResource (string filename)
 Opens a stream from a resource.
stream FromFile (string filename, FileStream mode)
 Opens a stream from a file.
void Close (stream stream)
 Closes a stream.
void Seek (stream stream, integer offset)
 Seeks a stream, relative to the start of the stream.
void SeekEnd (stream stream, integer offset)
 Seeks a stream, relative to the end.
void Skip (stream stream, integer offset)
 Seeks a stream, relative to the current position.
integer Position (stream stream)
 Returns the current position of the stream.
integer Length (stream stream)
 Returns the length of the stream.
integer ReadByte (stream stream)
 Reads an unsigned 8-bit number from the stream.
integer ReadUInt16 (stream stream)
 Reads an unsigned 16-bit number from the stream.
integer ReadUInt16BE (stream stream)
 Reads an unsigned big-endian 16-bit number from the stream.
integer ReadUInt32 (stream stream)
 Reads an unsigned 32-bit number from the stream.
integer ReadUInt32BE (stream stream)
 Reads an unsigned big-endian 32-bit number from the stream.
integer ReadUInt64 (stream stream)
 Reads an unsigned 64-bit number from the stream.
integer ReadInt16 (stream stream)
 Reads a signed 16-bit number from the stream.
integer ReadInt16BE (stream stream)
 Reads a signed big-endian 16-bit number from the stream.
integer ReadInt32 (stream stream)
 Reads a signed 32-bit number from the stream.
integer ReadInt32BE (stream stream)
 Reads a signed big-endian 32-bit number from the stream.
integer ReadInt64 (stream stream)
 Reads a signed 64-bit number from the stream.
decimal ReadFloat (stream stream)
 Reads a floating point number from the stream.
string ReadString (stream stream)
 Reads a null-terminated string from the stream.
string ReadLine (stream stream)
 Reads a line from the stream.
void WriteByte (stream stream, integer value)
 Writes an unsigned 8-bit number to the stream.
void WriteUInt16 (stream stream, integer value)
 Writes an unsigned 16-bit number to the stream.
void WriteUInt16BE (stream stream, integer value)
 Writes an unsigned big-endian 16-bit number to the stream.
void WriteUInt32 (stream stream, integer value)
 Writes an unsigned 32-bit number to the stream.
void WriteUInt32BE (stream stream, integer value)
 Writes an unsigned big-endian 32-bit number to the stream.
void WriteUInt64 (stream stream, integer value)
 Writes an unsigned 64-bit number to the stream.
void WriteInt16 (stream stream, integer value)
 Writes a signed 16-bit number to the stream.
void WriteInt16BE (stream stream, integer value)
 Writes a signed big-endian 16-bit number to the stream.
void WriteInt32 (stream stream, integer value)
 Writes a signed 32-bit number to the stream.
void WriteInt32BE (stream stream, integer value)
 Writes a signed big-endian 32-bit number to the stream.
void WriteInt64 (stream stream, integer value)
 Writes a signed 64-bit number to the stream.
void WriteFloat (stream stream, decimal value)
 Writes a floating point number to the stream.
void WriteString (stream stream, string string)
 Writes a null-terminated string to the stream.

Detailed Description

Functions for opening streams, as well as functions for reading and writing data.

Member Function Documentation

◆ Close()

void Stream.Close ( stream stream)

Closes a stream.

Parameters
streamThe stream to close.

◆ FromFile()

stream Stream.FromFile ( string filename,
FileStream mode )

Opens a stream from a file.

Parameters
filenamePath of the file.
modeThe file access mode.
Returns
Returns the newly opened stream.

◆ FromResource()

stream Stream.FromResource ( string filename)

Opens a stream from a resource.

Parameters
filenameFilename of the resource.
Returns
Returns the newly opened stream.

◆ Length()

integer Stream.Length ( stream stream)

Returns the length of the stream.

Parameters
streamThe stream.
Returns
The length of the stream.

◆ Position()

integer Stream.Position ( stream stream)

Returns the current position of the stream.

Parameters
streamThe stream.
Returns
The current position of the stream.

◆ ReadByte()

integer Stream.ReadByte ( stream stream)

Reads an unsigned 8-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned 8-bit number as an integer value.

◆ ReadFloat()

decimal Stream.ReadFloat ( stream stream)

Reads a floating point number from the stream.

Parameters
streamThe stream.
Returns
Returns a decimal value.

◆ ReadInt16()

integer Stream.ReadInt16 ( stream stream)

Reads a signed 16-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns a signed 16-bit number as an integer value.

◆ ReadInt16BE()

integer Stream.ReadInt16BE ( stream stream)

Reads a signed big-endian 16-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns a signed big-endian 16-bit number as an integer value.

◆ ReadInt32()

integer Stream.ReadInt32 ( stream stream)

Reads a signed 32-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns a signed 32-bit number as an integer value.

◆ ReadInt32BE()

integer Stream.ReadInt32BE ( stream stream)

Reads a signed big-endian 32-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns a signed big-endian 32-bit number as an integer value.

◆ ReadInt64()

integer Stream.ReadInt64 ( stream stream)

Reads a signed 64-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns a signed 64-bit Integer value.

◆ ReadLine()

string Stream.ReadLine ( stream stream)

Reads a line from the stream.

Parameters
streamThe stream.
Returns
Returns a string value.

◆ ReadString()

string Stream.ReadString ( stream stream)

Reads a null-terminated string from the stream.

Parameters
streamThe stream.
Returns
Returns a string value.

◆ ReadUInt16()

integer Stream.ReadUInt16 ( stream stream)

Reads an unsigned 16-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned 16-bit number as an integer value.

◆ ReadUInt16BE()

integer Stream.ReadUInt16BE ( stream stream)

Reads an unsigned big-endian 16-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned big-endian 16-bit number as an integer value.

◆ ReadUInt32()

integer Stream.ReadUInt32 ( stream stream)

Reads an unsigned 32-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned 32-bit number as an integer value.

◆ ReadUInt32BE()

integer Stream.ReadUInt32BE ( stream stream)

Reads an unsigned big-endian 32-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned big-endian 32-bit number as an integer value.

◆ ReadUInt64()

integer Stream.ReadUInt64 ( stream stream)

Reads an unsigned 64-bit number from the stream.

Parameters
streamThe stream.
Returns
Returns an unsigned 64-bit number as an integer value.

◆ Seek()

void Stream.Seek ( stream stream,
integer offset )

Seeks a stream, relative to the start of the stream.

Parameters
streamThe stream to seek.
offsetOffset to seek to.

◆ SeekEnd()

void Stream.SeekEnd ( stream stream,
integer offset )

Seeks a stream, relative to the end.

Parameters
streamThe stream to seek.
offsetOffset to seek to.

◆ Skip()

void Stream.Skip ( stream stream,
integer offset )

Seeks a stream, relative to the current position.

Parameters
streamThe stream to skip.
offsetHow many bytes to skip.

◆ WriteByte()

void Stream.WriteByte ( stream stream,
integer value )

Writes an unsigned 8-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteFloat()

void Stream.WriteFloat ( stream stream,
decimal value )

Writes a floating point number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteInt16()

void Stream.WriteInt16 ( stream stream,
integer value )

Writes a signed 16-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteInt16BE()

void Stream.WriteInt16BE ( stream stream,
integer value )

Writes a signed big-endian 16-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteInt32()

void Stream.WriteInt32 ( stream stream,
integer value )

Writes a signed 32-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteInt32BE()

void Stream.WriteInt32BE ( stream stream,
integer value )

Writes a signed big-endian 32-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteInt64()

void Stream.WriteInt64 ( stream stream,
integer value )

Writes a signed 64-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteString()

void Stream.WriteString ( stream stream,
string string )

Writes a null-terminated string to the stream.

Parameters
streamThe stream.
stringThe string to write.

◆ WriteUInt16()

void Stream.WriteUInt16 ( stream stream,
integer value )

Writes an unsigned 16-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteUInt16BE()

void Stream.WriteUInt16BE ( stream stream,
integer value )

Writes an unsigned big-endian 16-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteUInt32()

void Stream.WriteUInt32 ( stream stream,
integer value )

Writes an unsigned 32-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteUInt32BE()

void Stream.WriteUInt32BE ( stream stream,
integer value )

Writes an unsigned big-endian 32-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.

◆ WriteUInt64()

void Stream.WriteUInt64 ( stream stream,
integer value )

Writes an unsigned 64-bit number to the stream.

Parameters
streamThe stream.
valueThe value to write.