C# Class Apache.NMS.Util.EndianBinaryWriter

Inheritance: System.IO.BinaryWriter
Datei anzeigen Open project: ThorTech/apache-nms

Public Methods

Method Description
EndianBinaryWriter ( Stream output ) : System
Write ( String text ) : void

Method Write, writes a string to the output using the WriteString16 method.

Write ( char chars ) : void

Method Write

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

Method Write

Write ( double value ) : void

Method Write

Write ( float value ) : void

Method Write

Write ( int value ) : void

Method Write

Write ( long value ) : void

Method Write

Write ( short value ) : void

Method Write

Write ( uint value ) : void

Method Write

Write ( ulong value ) : void

Method Write

Write ( ushort value ) : void

Method Write

WriteString16 ( String text ) : void

Method WriteString16, writes a string to the output using the Java standard modified UTF-8 encoding with an unsigned short value written first to indicate the length of the encoded data, the short is read as an unsigned value so the max amount of data this method can write is 65535 encoded bytes. Unlike the WriteString32 method this method does not encode the length value to -1 if the string is null, this is to match the behaviour of the Java DataOuputStream class's writeUTF method. Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an unsigned short.

WriteString32 ( String text ) : void

Method WriteString32, writes a string to the output using the Openwire standard modified UTF-8 encoding which an int value written first to indicate the length of the encoded data, the int is read as an signed value so the max amount of data this method can write is 2^31 encoded bytes. In the case of a null value being passed this method writes a -1 to the stream to indicate that the string is null. Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an int.

Private Methods

Method Description
CountUtf8Bytes ( char chars ) : uint
encodeUTF8toBuffer ( char chars, byte buffer ) : void

Method Details

EndianBinaryWriter() public method

public EndianBinaryWriter ( Stream output ) : System
output Stream
return System

Write() public method

Method Write, writes a string to the output using the WriteString16 method.
public Write ( String text ) : void
text String A string
return void

Write() public method

Method Write
public Write ( char chars ) : void
chars char A char[]
return void

Write() public method

Method Write
public Write ( char chars, int index, int count ) : void
chars char A char[]
index int An int
count int An int
return void

Write() public method

Method Write
public Write ( double value ) : void
value double A double
return void

Write() public method

Method Write
public Write ( float value ) : void
value float A double
return void

Write() public method

Method Write
public Write ( int value ) : void
value int An int
return void

Write() public method

Method Write
public Write ( long value ) : void
value long A long
return void

Write() public method

Method Write
public Write ( short value ) : void
value short A short
return void

Write() public method

Method Write
public Write ( uint value ) : void
value uint An uint
return void

Write() public method

Method Write
public Write ( ulong value ) : void
value ulong An ulong
return void

Write() public method

Method Write
public Write ( ushort value ) : void
value ushort An ushort
return void

WriteString16() public method

Method WriteString16, writes a string to the output using the Java standard modified UTF-8 encoding with an unsigned short value written first to indicate the length of the encoded data, the short is read as an unsigned value so the max amount of data this method can write is 65535 encoded bytes. Unlike the WriteString32 method this method does not encode the length value to -1 if the string is null, this is to match the behaviour of the Java DataOuputStream class's writeUTF method. Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an unsigned short.
public WriteString16 ( String text ) : void
text String A string
return void

WriteString32() public method

Method WriteString32, writes a string to the output using the Openwire standard modified UTF-8 encoding which an int value written first to indicate the length of the encoded data, the int is read as an signed value so the max amount of data this method can write is 2^31 encoded bytes. In the case of a null value being passed this method writes a -1 to the stream to indicate that the string is null. Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an int.
public WriteString32 ( String text ) : void
text String A string
return void