Table of Contents

Class EndianBinaryWriter

Namespace
FellowOakDicom.IO
Assembly
fo-dicom.core.dll

Endian aware binary writer.

public class EndianBinaryWriter : BinaryWriter, IAsyncDisposable, IDisposable
Inheritance
EndianBinaryWriter
Implements
Inherited Members
Extension Methods

Constructors

EndianBinaryWriter(Stream, Endian, bool)

Initializes an instance of the EndianBinaryWriter class.

public EndianBinaryWriter(Stream output, Endian endian, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

endian Endian

Endianness of the output.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

EndianBinaryWriter(Stream, bool)

Initializes an instance of the EndianBinaryWriter class.

public EndianBinaryWriter(Stream output, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

Remarks

Uses the endianness of the system.

EndianBinaryWriter(Stream, Encoding, Endian, bool)

Initializes an instance of the EndianBinaryWriter class.

public EndianBinaryWriter(Stream output, Encoding encoding, Endian endian, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

encoding Encoding

Output encoding.

endian Endian

Endianness of the output.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

EndianBinaryWriter(Stream, Encoding, bool)

Initializes an instance of the EndianBinaryWriter class.

public EndianBinaryWriter(Stream output, Encoding encoding, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

encoding Encoding

Output encoding.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

Remarks

Uses the endianness of the system.

Properties

Endian

Gets or sets the endianness of the binary writer.

public Endian Endian { get; protected set; }

Property Value

Endian

Methods

Create(Stream, Endian, bool)

Convenience method for creating a sufficient binary writer based on specified endian.

public static BinaryWriter Create(Stream output, Endian endian, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

endian Endian

Endianness of the output.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

Returns

BinaryWriter

Binary writer with desired endian-

Create(Stream, Encoding, Endian, bool)

Convenience method for creating a sufficient binary writer based on specified endian.

public static BinaryWriter Create(Stream output, Encoding encoding, Endian endian, bool leaveOpen)

Parameters

output Stream

Stream to which output should be written.

encoding Encoding

Output encoding.

endian Endian

Endianness of the output.

leaveOpen bool

true to leave the stream open after the BinaryWriter object is disposed; otherwise, false.

Returns

BinaryWriter

Binary writer with desired endian-

Write(double)

Writes an eight-byte floating-point value to the current stream and advances the stream position by eight bytes.

public override void Write(double value)

Parameters

value double

The eight-byte floating-point value to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(short)

Writes a two-byte signed integer to the current stream and advances the stream position by two bytes.

public override void Write(short value)

Parameters

value short

The two-byte signed integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(int)

Writes a four-byte signed integer to the current stream and advances the stream position by four bytes.

public override void Write(int value)

Parameters

value int

The four-byte signed integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(long)

Writes an eight-byte signed integer to the current stream and advances the stream position by eight bytes.

public override void Write(long value)

Parameters

value long

The eight-byte signed integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(float)

Writes a four-byte floating-point value to the current stream and advances the stream position by four bytes.

public override void Write(float value)

Parameters

value float

The four-byte floating-point value to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(ushort)

Writes a two-byte unsigned integer to the current stream and advances the stream position by two bytes.

public override void Write(ushort value)

Parameters

value ushort

The two-byte unsigned integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(uint)

Writes a four-byte unsigned integer to the current stream and advances the stream position by four bytes.

public override void Write(uint value)

Parameters

value uint

The four-byte unsigned integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.

Write(ulong)

Writes an eight-byte unsigned integer to the current stream and advances the stream position by eight bytes.

public override void Write(ulong value)

Parameters

value ulong

The eight-byte unsigned integer to write.

Exceptions

IOException

An I/O error occurs.

ObjectDisposedException

The stream is closed.