C# Class Gammtek.Conduit.IO.EndianWriter

A BinaryWriter implementation to write individual bits to a stream and support writing data types for platforms with different Endian configurations. Note: for compatibility with streams written with BinaryWriter, character data uses the provided encoding and does not perform any Endian swapping with the data.
Inheritance: System.IO.BinaryWriter
Show file Open project: ME3Explorer/ME3Explorer

Public Methods

Method Description
EndianWriter ( ) : System

Initializes a new instance of the EndianWriter class.

EndianWriter ( BinaryWriter target ) : System

Creates an EndianWriter using the given target BinaryWriter.

EndianWriter ( Stream stream ) : System

Initializes a new instance of the EndianWriter class with the underlying stream and default encoding (UTF8).

EndianWriter ( Stream stream, Encoding encoding ) : System

Initializes a new instance of the EndianWriter class with the underlying stream and encoding.

Flush ( ) : void

Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

Seek ( int offset, SeekOrigin origin ) : long

Sets the position within the current stream.

Write ( bool value ) : void

Writes a one-byte Boolean value to the current stream, with 0 representing false and 1 representing true.

Write ( byte value ) : void

Writes one byte to the current stream.

Write ( byte buffer, int index, int count ) : void

Writes a region of a byte array to the current stream.

Write ( char ch ) : void

Writes a character to the stream using the provided encoding.

Write ( char chars, int index, int count ) : void

Writes a region of a character array to the current stream.

Write ( double value ) : void

Writes an eight byte double value to the stream in the target Endian format.

Write ( float value ) : void

Writes a four byte float value to the stream in the target Endian format.

Write ( int value ) : void

Writes a four byte signed integer value to the stream in the target Endian format.

Write ( long value ) : void

Writes an eight byte signed integer value to the stream in the target Endian format.

Write ( sbyte value ) : void

Writes a one byte signed byte value to the stream.

Write ( short value ) : void

Writes a two byte signed integer value to the stream in the target Endian format.

Write ( string value ) : void

Writes a string to the stream using the provided encoding and a variable integer length marker.

Write ( uint value ) : void

Writes a four byte unsigned integer value to the stream in the target Endian format.

Write ( ulong value ) : void

Writes an eight byte unsigned integer value to the stream in the target Endian format.

Write ( ushort value ) : void

Writes a two byte unsigned integer value to the stream in the target Endian format.

Method Details

EndianWriter() public method

Initializes a new instance of the EndianWriter class.
public EndianWriter ( ) : System
return System

EndianWriter() public method

Creates an EndianWriter using the given target BinaryWriter.
public EndianWriter ( BinaryWriter target ) : System
target System.IO.BinaryWriter
return System

EndianWriter() public method

Initializes a new instance of the EndianWriter class with the underlying stream and default encoding (UTF8).
public EndianWriter ( Stream stream ) : System
stream Stream
return System

EndianWriter() public method

Initializes a new instance of the EndianWriter class with the underlying stream and encoding.
public EndianWriter ( Stream stream, Encoding encoding ) : System
stream Stream
encoding System.Text.Encoding
return System

Flush() public method

Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
public Flush ( ) : void
return void

Seek() public method

Sets the position within the current stream.
public Seek ( int offset, SeekOrigin origin ) : long
offset int
origin SeekOrigin
return long

Write() public method

Writes a one-byte Boolean value to the current stream, with 0 representing false and 1 representing true.
public Write ( bool value ) : void
value bool
return void

Write() public method

Writes one byte to the current stream.
public Write ( byte value ) : void
value byte
return void

Write() public method

Writes a region of a byte array to the current stream.
public Write ( byte buffer, int index, int count ) : void
buffer byte
index int
count int
return void

Write() public method

Writes a character to the stream using the provided encoding.
public Write ( char ch ) : void
ch char
return void

Write() public method

Writes a region of a character array to the current stream.
public Write ( char chars, int index, int count ) : void
chars char
index int
count int
return void

Write() public method

Writes an eight byte double value to the stream in the target Endian format.
public Write ( double value ) : void
value double
return void

Write() public method

Writes a four byte float value to the stream in the target Endian format.
public Write ( float value ) : void
value float
return void

Write() public method

Writes a four byte signed integer value to the stream in the target Endian format.
public Write ( int value ) : void
value int
return void

Write() public method

Writes an eight byte signed integer value to the stream in the target Endian format.
public Write ( long value ) : void
value long
return void

Write() public method

Writes a one byte signed byte value to the stream.
public Write ( sbyte value ) : void
value sbyte
return void

Write() public method

Writes a two byte signed integer value to the stream in the target Endian format.
public Write ( short value ) : void
value short
return void

Write() public method

Writes a string to the stream using the provided encoding and a variable integer length marker.
public Write ( string value ) : void
value string
return void

Write() public method

Writes a four byte unsigned integer value to the stream in the target Endian format.
public Write ( uint value ) : void
value uint
return void

Write() public method

Writes an eight byte unsigned integer value to the stream in the target Endian format.
public Write ( ulong value ) : void
value ulong
return void

Write() public method

Writes a two byte unsigned integer value to the stream in the target Endian format.
public Write ( ushort value ) : void
value ushort
return void