Class BinaryFormat
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
StreamStream 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
StreamBinary stream.
offset
longOffset from the DataStream start.
length
longLength 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
stringThe path of the file.
mode
FileOpenModeThe mode to open the file.
Properties
Disposed
Gets a value indicating whether this BinaryFormat is disposed.
public bool Disposed { get; }
Property Value
Stream
Gets the stream.
public DataStream Stream { get; }
Property Value
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)