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
outputStreamStream to which output should be written.
endianEndianEndianness of the output.
leaveOpenbooltrue 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
outputStreamStream to which output should be written.
leaveOpenbooltrue 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
outputStreamStream to which output should be written.
encodingEncodingOutput encoding.
endianEndianEndianness of the output.
leaveOpenbooltrue 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
outputStreamStream to which output should be written.
encodingEncodingOutput encoding.
leaveOpenbooltrue 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
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
outputStreamStream to which output should be written.
endianEndianEndianness of the output.
leaveOpenbooltrue 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
outputStreamStream to which output should be written.
encodingEncodingOutput encoding.
endianEndianEndianness of the output.
leaveOpenbooltrue 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
valuedoubleThe 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
valueshortThe 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
valueintThe 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
valuelongThe 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
valuefloatThe 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
valueushortThe 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
valueuintThe 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
valueulongThe eight-byte unsigned integer to write.
Exceptions
- IOException
An I/O error occurs.
- ObjectDisposedException
The stream is closed.