Quantum 3 3.0.13

Static Public Member Functions | List of all members
Quantum.Core.StreamUtils Class Reference

Streaming utility methods. More...

Static Public Member Functions

static int ReadInt (this BinaryReader reader, int offset=0)
 Read an integer from a binary reader. More...
 
static int ReadInt (this Stream stream, int offset=0)
 Read an integer from a stream. More...
 
static long SeekOrThrow (this Stream stream, long offset, SeekOrigin seekOrigin)
 Seek to a position in the stream or throw on error. More...
 

Detailed Description

Streaming utility methods.

Member Function Documentation

◆ ReadInt() [1/2]

static int Quantum.Core.StreamUtils.ReadInt ( this BinaryReader  reader,
int  offset = 0 
)
inlinestatic

Read an integer from a binary reader.

Parameters
readerReader
offsetRead position offset
Returns
Converted integer that was read from the stream
Exceptions
ArgumentNullExceptionIs raised when the reader is null
ExceptionIs raised when the integer could not be read from the stream

◆ ReadInt() [2/2]

static int Quantum.Core.StreamUtils.ReadInt ( this Stream  stream,
int  offset = 0 
)
inlinestatic

Read an integer from a stream.

Parameters
streamStream to read from
offsetRead position offset
Returns
Exceptions
ArgumentNullExceptionIs raised when the stream is null
ExceptionIs raised when the stream is not readable, the offset is invalid or the integer could not be read

◆ SeekOrThrow()

static long Quantum.Core.StreamUtils.SeekOrThrow ( this Stream  stream,
long  offset,
SeekOrigin  seekOrigin 
)
inlinestatic

Seek to a position in the stream or throw on error.

Parameters
streamThe stream to seek in
offsetThe offset to seek to
seekOriginThe origin to seek from
Returns
The position after seeking
Exceptions
ArgumentNullExceptionIs raised when the stream is null
ExceptionIs raised when the stream is not seek-able or the seeking failed.