Click or drag to resize

BinaryDataWriter Class

Represents an extended BinaryWriter 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 BinaryDataWriter : BinaryWriter

The BinaryDataWriter type exposes the following members.

Constructors
  NameDescription
Public methodBinaryDataWriter(Stream)
Initializes a new instance of the BinaryDataWriter class based on the specified stream and using UTF-8 encoding.
Public methodBinaryDataWriter(Stream, Boolean)
Initializes a new instance of the BinaryDataWriter class based on the specified stream, UTF-8 encoding and optionally leaves the stream open.
Public methodBinaryDataWriter(Stream, Encoding)
Initializes a new instance of the BinaryDataWriter class based on the specified stream and character encoding.
Public methodBinaryDataWriter(Stream, Encoding, Boolean)
Initializes a new instance of the BinaryDataWriter 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 BinaryWriter 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.
Public propertyLength
Gets or sets 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 writer to the next given byte multiple.
Public methodReserveOffset
Allocates space for an Offset which can be satisfied later on.
Public methodReserveOffset(Int32)
Allocates space for a given number of Offset instances which can be satisfied later on.
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.
Public methodWrite(IEnumerableDecimal)
Writes an enumeration of Decimal values to the current stream and advances the current position by that number of Decimal values multiplied with the size of a single value.
Public methodWrite(IEnumerableDouble)
Writes an enumeration of Double values to the current stream and advances the current position by that number of Double values multiplied with the size of a single value.
Public methodWrite(IEnumerableInt16)
Writes an enumeration of Int16 values to the current stream and advances the current position by that number of Int16 values multiplied with the size of a single value.
Public methodWrite(IEnumerableInt32)
Writes an enumeration of Int32 values to the current stream and advances the current position by that number of Int32 values multiplied with the size of a single value.
Public methodWrite(IEnumerableInt64)
Writes an enumeration of Int64 values to the current stream and advances the current position by that number of Int64 values multiplied with the size of a single value.
Public methodWrite(IEnumerableSingle)
Writes an enumeration of Single values to the current stream and advances the current position by that number of Single values multiplied with the size of a single value.
Public methodWrite(IEnumerableUInt16)
Writes an enumeration of UInt16 values to the current stream and advances the current position by that number of UInt16 values multiplied with the size of a single value.
Public methodWrite(IEnumerableUInt32)
Writes an enumeration of UInt32 values to the current stream and advances the current position by that number of UInt32 values multiplied with the size of a single value.
Public methodWrite(IEnumerableUInt64)
Writes an enumeration of UInt64 values to the current stream and advances the current position by that number of UInt64 values multiplied with the size of a single value.
Public methodWrite(Decimal)
Writes an 16-byte floating point value to this stream and advances the current position of the stream by sixteen bytes.
(Overrides BinaryWriterWrite(Decimal).)
Public methodWrite(Double)
Writes an 8-byte floating point value to this stream and advances the current position of the stream by eight bytes.
(Overrides BinaryWriterWrite(Double).)
Public methodWrite(Int16)
Writes an 2-byte signed integer to this stream and advances the current position of the stream by two bytes.
(Overrides BinaryWriterWrite(Int16).)
Public methodWrite(Int32)
Writes an 4-byte signed integer to this stream and advances the current position of the stream by four bytes.
(Overrides BinaryWriterWrite(Int32).)
Public methodWrite(Int64)
Writes an 8-byte signed integer to this stream and advances the current position of the stream by eight bytes.
(Overrides BinaryWriterWrite(Int64).)
Public methodWrite(Single)
Writes an 4-byte floating point value to this stream and advances the current position of the stream by four bytes.
(Overrides BinaryWriterWrite(Single).)
Public methodWrite(UInt16)
Writes an 2-byte unsigned integer value to this stream and advances the current position of the stream by two bytes.
(Overrides BinaryWriterWrite(UInt16).)
Public methodWrite(UInt32)
Writes an 4-byte unsigned integer value to this stream and advances the current position of the stream by four bytes.
(Overrides BinaryWriterWrite(UInt32).)
Public methodWrite(UInt64)
Writes an 8-byte unsigned integer value to this stream and advances the current position of the stream by eight bytes.
(Overrides BinaryWriterWrite(UInt64).)
Public methodWrite(Boolean, BooleanDataFormat)
Writes a Boolean value in the given format to the current stream, with 0 representing false and 1 representing true.
Public methodWrite(IEnumerableBoolean, BooleanDataFormat)
Writes an enumeration of Boolean values to the current stream, with 0 representing false and 1 representing true.
Public methodWrite(IEnumerableDateTime, DateTimeDataFormat)
Writes an enumeration of DateTime values to this stream. The DateTime values will be available in the specified binary format.
Public methodWrite(DateTime, DateTimeDataFormat)
Writes a DateTime value to this stream. The DateTime will be available in the specified binary format.
Public methodWrite(IEnumerableString, StringDataFormat, Encoding)
Writes an enumeration of String values to this stream with the given encoding. The strings will be available in the specified binary format.
Public methodWrite(String, StringDataFormat, Encoding)
Writes a string to this stream with the given encoding and advances the current position of the stream in accordance with the encoding used and the specific characters being written to the stream. The string will be available in the specified binary format.
Public methodWriteEnumT
Writes an enum value to this stream and advances the current position of the stream by the size of the underlying enum type size. Optionally validates the value to be defined in the enum type.
Public methodWriteEnumsT
Writes an enumeration of enum values to this stream and advances the current position of the stream by the size of the underlying enum type size multiplied by the number of values. Optionally validates the values to be defined in the enum type.
Public methodWriteObject
Writes an object or enumerable of objects to this stream.
Top
See Also