Class EndianBinaryWriter
Endian aware binary writer.
Inheritance
Implements
Inherited Members
Namespace: FellowOakDicom.IO
Assembly: fo-dicom.core.dll
Syntax
public class EndianBinaryWriter : BinaryWriter, IDisposable
Constructors
EndianBinaryWriter(Stream, Endian, Boolean)
Initializes an instance of the EndianBinaryWriter class.
Declaration
public EndianBinaryWriter(Stream output, Endian endian, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
Endian | endian | Endianness of the output. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
EndianBinaryWriter(Stream, Boolean)
Initializes an instance of the EndianBinaryWriter class.
Declaration
public EndianBinaryWriter(Stream output, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
Remarks
Uses the endianness of the system.
EndianBinaryWriter(Stream, Encoding, Endian, Boolean)
Initializes an instance of the EndianBinaryWriter class.
Declaration
public EndianBinaryWriter(Stream output, Encoding encoding, Endian endian, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
System.Text.Encoding | encoding | Output encoding. |
Endian | endian | Endianness of the output. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
EndianBinaryWriter(Stream, Encoding, Boolean)
Initializes an instance of the EndianBinaryWriter class.
Declaration
public EndianBinaryWriter(Stream output, Encoding encoding, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
System.Text.Encoding | encoding | Output encoding. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
Remarks
Uses the endianness of the system.
Properties
Endian
Gets or sets the endianness of the binary writer.
Declaration
public Endian Endian { get; protected set; }
Property Value
Type | Description |
---|---|
Endian |
Methods
Create(Stream, Endian, Boolean)
Convenience method for creating a sufficient binary writer based on specified endian
.
Declaration
public static BinaryWriter Create(Stream output, Endian endian, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
Endian | endian | Endianness of the output. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
Returns
Type | Description |
---|---|
System.IO.BinaryWriter | Binary writer with desired |
Create(Stream, Encoding, Endian, Boolean)
Convenience method for creating a sufficient binary writer based on specified endian
.
Declaration
public static BinaryWriter Create(Stream output, Encoding encoding, Endian endian, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | output | Stream to which output should be written. |
System.Text.Encoding | encoding | Output encoding. |
Endian | endian | Endianness of the output. |
System.Boolean | leaveOpen | true to leave the stream open after the System.IO.BinaryWriter object is disposed; otherwise, false. |
Returns
Type | Description |
---|---|
System.IO.BinaryWriter | Binary writer with desired |
Write(Double)
Declaration
public override void Write(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value |
Overrides
Write(Int16)
Declaration
public override void Write(short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value |
Overrides
Write(Int32)
Declaration
public override void Write(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value |
Overrides
Write(Int64)
Declaration
public override void Write(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value |
Overrides
Write(Single)
Declaration
public override void Write(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value |
Overrides
Write(UInt16)
Declaration
public override void Write(ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value |
Overrides
Write(UInt32)
Declaration
public override void Write(uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value |
Overrides
Write(UInt64)
Declaration
public override void Write(ulong value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | value |