Click or drag to resize

BinaryDataReader Class

Represents an extended BinaryReader supporting special file format data types.
Inheritance Hierarchy

Namespace:  Syroot.BinaryData
Assembly:  Syroot.BinaryData (in Syroot.BinaryData.dll) Version: 4.0.0
Syntax
public class BinaryDataReader : BinaryReader

The BinaryDataReader type exposes the following members.

Constructors
  NameDescription
Public methodBinaryDataReader(Stream)
Initializes a new instance of the BinaryDataReader class based on the specified stream and using UTF-8 encoding.
Public methodBinaryDataReader(Stream, Boolean)
Initializes a new instance of the BinaryDataReader class based on the specified stream, UTF-8 encoding and optionally leaves the stream open.
Public methodBinaryDataReader(Stream, Encoding)
Initializes a new instance of the BinaryDataReader class based on the specified stream and character encoding.
Public methodBinaryDataReader(Stream, Encoding, Boolean)
Initializes a new instance of the BinaryDataReader class based on the specified stream and character encoding, and optionally leaves the stream open.
Top
Properties
  NameDescription
Public propertyByteConverter
Gets or sets the ByteConverter instance used to parse multibyte binary data with.
Public propertyByteOrder
Gets or sets the byte order used to parse multibyte binary data with.
Public propertyEncoding
Gets the encoding used for string related operations where no other encoding has been provided. Due to the way the underlying BinaryReader is instantiated, it can only be specified at creation time.
Public propertyEndOfStream
Gets a value indicating whether the end of the stream has been reached and no more data can be read.
Public propertyLength
Gets the length in bytes of the stream in bytes.
Public propertyPosition
Gets or sets the position within the current stream. This is a shortcut to the base stream Position property.
Top
Methods
  NameDescription
Public methodAlign
Aligns the reader to the next given byte multiple.
Public methodReadBoolean
Reads a Boolean value from the current stream. The Boolean is available in the specified binary format.
Public methodReadBooleans
Reads the specified number of Boolean values from the current stream into a Boolean array. The Boolean values are available in the specified binary format.
Public methodReadDateTime
Reads a DateTime from the current stream. The DateTime is available in the specified binary format.
Public methodReadDateTimes
Reads the specified number of DateTime values from the current stream into a DateTime array. The DateTime values are available in the specified binary format.
Public methodReadDecimal
Reads an 16-byte floating point value from the current stream and advances the current position of the stream by sixteen bytes.
(Overrides BinaryReaderReadDecimal.)
Public methodReadDecimals
Reads the specified number of Decimal values from the current stream into a Decimal array and advances the current position by that number of Decimal values multiplied with the size of a single value.
Public methodReadDouble
Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes.
(Overrides BinaryReaderReadDouble.)
Public methodReadDoubles
Reads the specified number of Double values from the current stream into a Double array and advances the current position by that number of Double values multiplied with the size of a single value.
Public methodReadEnumT
Reads the specified enum value from the current stream and advances the current position by the size of the underlying enum type. Optionally validates the value to be defined in the enum type.
Public methodReadEnumsT
Reads the specified number of enum values from the current stream into an array of the enum type. Optionally validates values to be defined in the enum type.
Public methodReadInt16
Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes.
(Overrides BinaryReaderReadInt16.)
Public methodReadInt16s
Reads the specified number of Int16 values from the current stream into a Int16 array and advances the current position by that number of Int16 values multiplied with the size of a single value.
Public methodReadInt32
Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.
(Overrides BinaryReaderReadInt32.)
Public methodReadInt32s
Reads the specified number of Int32 values from the current stream into a Int32 array and advances the current position by that number of Int32 values multiplied with the size of a single value.
Public methodReadInt64
Reads an 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes.
(Overrides BinaryReaderReadInt64.)
Public methodReadInt64s
Reads the specified number of Int64 values from the current stream into a Int64 array and advances the current position by that number of Int64 values multiplied with the size of a single value.
Public methodReadObjectT
Reads an object of type T from the current stream.
Public methodReadObjectsT
Reads the specified number of objects of type T from the current stream.
Public methodReadSBytes
Reads the specified number of SByte values from the current stream into a SByte array and advances the current position by that number of SByte values multiplied with the size of a single value.
Public methodReadSingle
Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes.
(Overrides BinaryReaderReadSingle.)
Public methodReadSingles
Reads the specified number of Single values from the current stream into a Single array and advances the current position by that number of Single values multiplied with the size of a single value.
Public methodReadString(Int32, Encoding)
Reads a string from the current stream. The string has neither a prefix or postfix, the length has to be specified manually. The string is available in the specified encoding.
Public methodReadString(StringDataFormat, Encoding)
Reads a string from the current stream. The string is available in the specified binary format and encoding.
Public methodReadStrings(Int32)
Reads the specified number of String values from the current stream into a String array.
Public methodReadStrings(Int32, StringDataFormat, Encoding)
Reads the specified number of String values from the current stream into a String array. The strings are available in the specified binary format and encoding.
Public methodReadStrings(Int32, Int32, Encoding)
Reads the specified number of String values from the current stream into a String array. The strings have neither a prefix or postfix, the length has to be specified manually. The strings are available in the specified encoding.
Public methodReadUInt16
Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the position of the stream by two bytes.
(Overrides BinaryReaderReadUInt16.)
Public methodReadUInt16s
Reads the specified number of UInt16 values from the current stream into a UInt16 array and advances the current position by that number of UInt16 values multiplied with the size of a single value.
Public methodReadUInt32
Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.
(Overrides BinaryReaderReadUInt32.)
Public methodReadUInt32s
Reads the specified number of UInt32 values from the current stream into a UInt32 array and advances the current position by that number of UInt32 values multiplied with the size of a single value.
Public methodReadUInt64
Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.
(Overrides BinaryReaderReadUInt64.)
Public methodReadUInt64s
Reads the specified number of UInt64 values from the current stream into a UInt64 array and advances the current position by that number of UInt64 values multiplied with the size of a single value.
Public methodSeek(Int64)
Sets the position within the current stream. This is a shortcut to the base stream Seek method.
Public methodSeek(Int64, SeekOrigin)
Sets the position within the current stream. This is a shortcut to the base stream Seek method.
Public methodTemporarySeek
Creates a SeekTask to restore the current position after it has been disposed.
Public methodTemporarySeek(Int64)
Creates a SeekTask with the given parameters. As soon as the returned SeekTask is disposed, the previous stream position will be restored.
Public methodTemporarySeek(Int64, SeekOrigin)
Creates a SeekTask with the given parameters. As soon as the returned SeekTask is disposed, the previous stream position will be restored.
Top
See Also