Table of Contents

Class FlexibleBinaryWriter

Namespace
PushTechnology.ClientInterface.IO
Assembly
Diffusion.Client.dll

The binary writer that is able to write basic data types to a stream.

public sealed class FlexibleBinaryWriter
Inheritance
FlexibleBinaryWriter
Inherited Members

Constructors

FlexibleBinaryWriter(Stream, ByteOrder)

Creates a new FlexibleBinaryWriter that will be able to write basic data types to the given stream.

public FlexibleBinaryWriter(Stream outputStream, ByteOrder byteOrder)

Parameters

outputStream Stream

The stream to write to.

byteOrder ByteOrder

The byte order to use for all writing operations.

Remarks

The reader does not take ownership of the given outputStream. The stream needs to be disposed of if it is no longer needed.

Exceptions

ArgumentNullException

The given stream is null.

ArgumentException

The given stream does not support writing.

Properties

BaseStream

Returns the underlying stream.

public Stream BaseStream { get; }

Property Value

Stream

The underlying stream.

ByteOrder

Returns the byte order the writer operates in.

public ByteOrder ByteOrder { get; }

Property Value

ByteOrder

The byte order the writer operates in.

Methods

Flush()

Causes any buffered data to be written to the stream.

public void Flush()

Write(byte)

Writes a single byte to the stream.

public void Write(byte value)

Parameters

value byte

The byte value to write to the stream.

Write(byte[])

Writes a sequence of bytes to the stream.

public void Write(byte[] value)

Parameters

value byte[]

The sequence of bytes to write to the stream.

Exceptions

ArgumentNullException

The given sequence of bytes is null.

Write(byte[], int, int)

Writes a segment of a byte sequence to the stream.

public void Write(byte[] value, int offset, int length)

Parameters

value byte[]

The segment of bytes to write to the stream.

offset int

The starting index of the array segment.

length int

The length of the array segment.

Exceptions

ArgumentNullException

The given array is null.

ArgumentOutOfRangeException

The given offset or length are negative or bigger than the given array.

Write(char)

Writes a 16-bit character to the stream.

public void Write(char value)

Parameters

value char

The 16-bit character to write to the stream.

Write(double)

Writes a 64-bit floating point to the stream.

public void Write(double value)

Parameters

value double

The 64-bit floating point to write to the stream.

Write(short)

Writes a 16-bit signed integer to the stream.

public void Write(short value)

Parameters

value short

The 16-bit signed integer to write to the stream.

Write(int)

Writes a 32-bit signed integer to the stream.

public void Write(int value)

Parameters

value int

The 32-bit signed integer to write to the stream.

Write(long)

Writes a 64-bit signed integer to the stream.

public void Write(long value)

Parameters

value long

The 64-bit signed integer to write to the stream.

Write(sbyte)

Writes a signed byte to the stream.

public void Write(sbyte value)

Parameters

value sbyte

The signed byte value to write to the stream.

Write(float)

Writes a 32-bit floating point to the stream.

public void Write(float value)

Parameters

value float

The 32-bit floating point to write to the stream.

Write(ushort)

Writes a 16-bit unsigned integer to the stream.

public void Write(ushort value)

Parameters

value ushort

The 16-bit unsigned integer to write to the stream.

Write(uint)

Writes a 32-bit unsigned integer to the stream.

public void Write(uint value)

Parameters

value uint

The 32-bit unsigned integer to write to the stream.

Write(ulong)

Writes a 64-bit unsigned integer to the stream.

public void Write(ulong value)

Parameters

value ulong

The 64-bit unsigned integer to write to the stream.