Table of Contents

Class BinaryFormat

Namespace
Yarhl.IO
Assembly
Yarhl.dll

Binary format.

public class BinaryFormat : IBinary, IDisposable, ICloneableFormat, IFormat
Inheritance
BinaryFormat
Implements
Inherited Members
Extension Methods

Constructors

BinaryFormat()

Initializes a new instance of the BinaryFormat class. Creates a stream in memory.

public BinaryFormat()

BinaryFormat(Stream)

Initializes a new instance of the BinaryFormat class.

public BinaryFormat(Stream stream)

Parameters

stream Stream

Stream to wrap as a format. It takes over the ownership of the stream. You must not dispose it.

BinaryFormat(Stream, long, long)

Initializes a new instance of the BinaryFormat class.

public BinaryFormat(Stream stream, long offset, long length)

Parameters

stream Stream

Binary stream.

offset long

Offset from the DataStream start.

length long

Length of the substream.

Remarks

This format creates an internal DataStream from the provided stream. It will take over the ownership of the stream argument, you should not dispose this argument, unless you are providing a DataStream that we won't take over in case you want to create more substreams.

BinaryFormat(string, FileOpenMode)

Initializes a new instance of the BinaryFormat class.

public BinaryFormat(string path, FileOpenMode mode)

Parameters

path string

The path of the file.

mode FileOpenMode

The mode to open the file.

Properties

Disposed

Gets a value indicating whether this BinaryFormat is disposed.

public bool Disposed { get; }

Property Value

bool

Stream

Gets the stream.

public DataStream Stream { get; }

Property Value

DataStream

Methods

DeepClone()

Makes a copy of the format stream into memory and returns a new BinaryFormat object.

public virtual object DeepClone()

Returns

object

The cloned BinaryFormat.

Remarks

The stream is copied into memory, so it is limited to 2GB size.

Dispose()

Releases all resource used by the BinaryFormat object.

public void Dispose()

Dispose(bool)

Releases all resource used by the BinaryFormat object.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

If set to true free managed resources also. It happens from Dispose() calls.