C# Class BinaryReaderExtensions, UnityRose

A collection of extensions for the BinaryReader class.
Exibir arquivo Open project: osROSE/UnityRose Class Usage Examples

Public Properties

Property Type Description
DefaultEncoding Encoding

Public Methods

Method Description
ReadByteString ( this reader ) : string

Reads a string with a pre-fixed length as a 8-bit integer from the underlying stream.

ReadByteString ( this reader, Encoding encoding ) : string

Reads a string with a pre-fixed length as a 8-bit integer from the underlying stream.

ReadColour3 ( this reader ) : Color

Reads a colour from the underlying stream.

ReadColour4 ( this reader ) : Color

Reads a colour from the underlying stream.

ReadIntString ( this reader ) : string

Reads a string with a pre-fixed length as a 32-bit integer from the underlying stream.

ReadIntString ( this reader, Encoding encoding ) : string

Reads a string with a pre-fixed length as a 32-bit integer from the underlying stream.

ReadMatrix ( this reader ) : Matrix4x4

Reads a matrix from the underlying stream.

ReadNullTerminatedString ( this reader ) : string

Reads a null-terminated string from the current stream.

ReadNullTerminatedString ( this reader, Encoding encoding ) : string

Reads a null-terminated string from the current stream.

ReadQuaternion ( this reader, bool w = false ) : Quaternion

Reads a quaternion from the underlying stream.

ReadShortString ( this reader ) : string

Reads a string with a pre-fixed length as a 16-bit integer from the underlying stream.

ReadShortString ( this reader, Encoding encoding ) : string

Reads a string with a pre-fixed length as a 16-bit integer from the underlying stream.

ReadShortVector3 ( this reader ) : ShortVector3

Reads a vector from the underlying stream.

ReadShortVector4 ( this reader ) : ShortVector4

Reads a vector from the underlying stream.

ReadString ( this reader, int length ) : string

Reads a fixed-length string from the underlying stream.

ReadString ( this reader, int length, Encoding encoding ) : string

Reads a fixed-length string from the underlying stream.

ReadVector2 ( this reader ) : Vector2

Reads a vector from the underlying stream.

ReadVector3 ( this reader ) : Vector3

Reads a vector from the underlying stream.

ReadVector4 ( this reader ) : Vector4

Reads a vector from the underlying stream.

Private Methods

Method Description
BinaryReaderExtensions ( ) : System.Collections.Generic

Initializes the BinaryReaderExtensions class.

Method Details

ReadByteString() public static method

Reads a string with a pre-fixed length as a 8-bit integer from the underlying stream.
public static ReadByteString ( this reader ) : string
reader this
return string

ReadByteString() public static method

Reads a string with a pre-fixed length as a 8-bit integer from the underlying stream.
public static ReadByteString ( this reader, Encoding encoding ) : string
reader this
encoding Encoding
return string

ReadColour3() public static method

Reads a colour from the underlying stream.
public static ReadColour3 ( this reader ) : Color
reader this
return Color

ReadColour4() public static method

Reads a colour from the underlying stream.
public static ReadColour4 ( this reader ) : Color
reader this
return Color

ReadIntString() public static method

Reads a string with a pre-fixed length as a 32-bit integer from the underlying stream.
public static ReadIntString ( this reader ) : string
reader this
return string

ReadIntString() public static method

Reads a string with a pre-fixed length as a 32-bit integer from the underlying stream.
public static ReadIntString ( this reader, Encoding encoding ) : string
reader this
encoding Encoding
return string

ReadMatrix() public static method

Reads a matrix from the underlying stream.
public static ReadMatrix ( this reader ) : Matrix4x4
reader this
return Matrix4x4

ReadNullTerminatedString() public static method

Reads a null-terminated string from the current stream.
public static ReadNullTerminatedString ( this reader ) : string
reader this
return string

ReadNullTerminatedString() public static method

Reads a null-terminated string from the current stream.
public static ReadNullTerminatedString ( this reader, Encoding encoding ) : string
reader this
encoding Encoding The character encoding.
return string

ReadQuaternion() public static method

Reads a quaternion from the underlying stream.
public static ReadQuaternion ( this reader, bool w = false ) : Quaternion
reader this The reader.
w bool if set to true the value is read in the order WXYZ, else XYZW.
return Quaternion

ReadShortString() public static method

Reads a string with a pre-fixed length as a 16-bit integer from the underlying stream.
public static ReadShortString ( this reader ) : string
reader this
return string

ReadShortString() public static method

Reads a string with a pre-fixed length as a 16-bit integer from the underlying stream.
public static ReadShortString ( this reader, Encoding encoding ) : string
reader this
encoding Encoding
return string

ReadShortVector3() public static method

Reads a vector from the underlying stream.
public static ReadShortVector3 ( this reader ) : ShortVector3
reader this
return ShortVector3

ReadShortVector4() public static method

Reads a vector from the underlying stream.
public static ReadShortVector4 ( this reader ) : ShortVector4
reader this
return ShortVector4

ReadString() public static method

Reads a fixed-length string from the underlying stream.
public static ReadString ( this reader, int length ) : string
reader this
length int The length of the string.
return string

ReadString() public static method

Reads a fixed-length string from the underlying stream.
public static ReadString ( this reader, int length, Encoding encoding ) : string
reader this
length int The length of the string.
encoding Encoding The character encoding.
return string

ReadVector2() public static method

Reads a vector from the underlying stream.
public static ReadVector2 ( this reader ) : Vector2
reader this
return Vector2

ReadVector3() public static method

Reads a vector from the underlying stream.
public static ReadVector3 ( this reader ) : Vector3
reader this
return Vector3

ReadVector4() public static method

Reads a vector from the underlying stream.
public static ReadVector4 ( this reader ) : Vector4
reader this
return Vector4

Property Details

DefaultEncoding public_oe static_oe property

The default encoding to be used when reading strings.
public static Encoding DefaultEncoding
return Encoding