Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.IO.FlexibleBinaryWriter Class Reference

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

Public Member Functions

 FlexibleBinaryWriter (Stream outputStream, ByteOrder byteOrder)
 Creates a new FlexibleBinaryWriter that will be able to write basic data types to the given stream. More...
 
void Write (byte[] value)
 Writes a sequence of bytes to the stream. More...
 
void Write (byte[] value, int offset, int length)
 Writes a segment of a byte sequence to the stream. More...
 
void Write (byte value)
 Writes a single byte to the stream. More...
 
void Write (sbyte value)
 Writes a signed byte to the stream. More...
 
void Write (char value)
 Writes a 16-bit character to the stream. More...
 
void Write (short value)
 Writes a 16-bit signed integer to the stream. More...
 
void Write (ushort value)
 Writes a 16-bit unsigned integer to the stream. More...
 
void Write (int value)
 Writes a 32-bit signed integer to the stream. More...
 
void Write (uint value)
 Writes a 32-bit unsigned integer to the stream. More...
 
void Write (long value)
 Writes a 64-bit signed integer to the stream. More...
 
void Write (ulong value)
 Writes a 64-bit unsigned integer to the stream. More...
 
void Write (float value)
 Writes a 32-bit floating point to the stream. More...
 
void Write (double value)
 Writes a 64-bit floating point to the stream. More...
 
void Flush ()
 Causes any buffered data to be written to the stream. More...
 

Public Attributes

ByteOrder ByteOrder => byteOrder
 Returns the byte order the writer operates in. More...
 
Stream BaseStream => outputStream
 Returns the underlying stream. More...
 

Detailed Description

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

Constructor & Destructor Documentation

PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.FlexibleBinaryWriter ( Stream  outputStream,
ByteOrder  byteOrder 
)

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

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

Parameters
outputStreamThe stream to write to.
byteOrderThe byte order to use for all writing operations.
Exceptions
ArgumentNullExceptionThe given stream is null.
ArgumentExceptionThe given stream does not support writing.

Member Function Documentation

void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Flush ( )

Causes any buffered data to be written to the stream.

void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( byte[]  value)

Writes a sequence of bytes to the stream.

Parameters
valueThe sequence of bytes to write to the stream.
Exceptions
ArgumentNullExceptionThe given sequence of bytes is null.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( byte[]  value,
int  offset,
int  length 
)

Writes a segment of a byte sequence to the stream.

Parameters
valueThe segment of bytes to write to the stream.
offsetThe starting index of the array segment.
lengthThe length of the array segment.
Exceptions
ArgumentNullExceptionThe given array is null.
ArgumentOutOfRangeExceptionThe given offset or length are negative or bigger than the given array.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( byte  value)

Writes a single byte to the stream.

Parameters
valueThe byte value to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( sbyte  value)

Writes a signed byte to the stream.

Parameters
valueThe signed byte value to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( char  value)

Writes a 16-bit character to the stream.

Parameters
valueThe 16-bit character to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( short  value)

Writes a 16-bit signed integer to the stream.

Parameters
valueThe 16-bit signed integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( ushort  value)

Writes a 16-bit unsigned integer to the stream.

Parameters
valueThe 16-bit unsigned integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( int  value)

Writes a 32-bit signed integer to the stream.

Parameters
valueThe 32-bit signed integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( uint  value)

Writes a 32-bit unsigned integer to the stream.

Parameters
valueThe 32-bit unsigned integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( long  value)

Writes a 64-bit signed integer to the stream.

Parameters
valueThe 64-bit signed integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( ulong  value)

Writes a 64-bit unsigned integer to the stream.

Parameters
valueThe 64-bit unsigned integer to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( float  value)

Writes a 32-bit floating point to the stream.

Parameters
valueThe 32-bit floating point to write to the stream.
void PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.Write ( double  value)

Writes a 64-bit floating point to the stream.

Parameters
valueThe 64-bit floating point to write to the stream.

Member Data Documentation

Stream PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.BaseStream => outputStream

Returns the underlying stream.

ByteOrder PushTechnology.ClientInterface.IO.FlexibleBinaryWriter.ByteOrder => byteOrder

Returns the byte order the writer operates in.


The documentation for this class was generated from the following file: