C# Class Lawo.EmberPlusSharp.Ember.EmberWriter

Represents a writer that provides the means to generate BER-encoded output, as specified in "X.690"X.690.
Only the subset defined in the "Ember+ Specification"Ember+ Specification is supported.
Inheritance: IDisposable
ファイルを表示 Open project: Lawo/ember-plus-sharp Class Usage Examples

Public Methods

Method Description
EmberWriter ( Stream stream ) : System

Initializes a new instance of the EmberWriter class by calling EmberWriter(Stream, int)">EmberWriter(

EmberWriter ( Stream stream, int bufferSize ) : System

Initializes a new instance of the EmberWriter class.

Flush ( ) : void

Flushes the internal buffer into the stream passed to the constructor.

WriteEndContainer ( ) : void

Writes the end of the previous sequence, set or application-defined type.

WriteStartApplicationDefinedType ( EmberId outer, int innerNumber ) : void

Writes outer with indefinite length followed by the start of an application-defined type with indefinite length.

WriteStartSequence ( EmberId outer ) : void

Writes outer with indefinite length followed by the start of a sequence with indefinite length.

WriteStartSet ( EmberId outer ) : void

Writes outer with indefinite length followed by the start of a set with indefinite length.

WriteValue ( EmberId outer, bool value ) : void

Writes outer with definite length followed by value as Boolean.

WriteValue ( EmberId outer, byte value ) : void

Writes outer with definite length followed by value as Octetstring.

WriteValue ( EmberId outer, double value ) : void

Writes outer with definite length followed by value as Real.

WriteValue ( EmberId outer, int value ) : void

Writes outer with definite length followed by value as Relative object identifier.

WriteValue ( EmberId outer, long value ) : void

Writes outer with definite length followed by value as Integer.

WriteValue ( EmberId outer, string value ) : void

Writes outer with definite length followed by value as UTF8String.

Private Methods

Method Description
AssertNotDisposed ( ) : void
Dispose ( ) : void
Get7BitStartShift ( int value ) : int
Get8BitStartShift ( long value, bool isSigned ) : int
GetLeadingOctet ( EmberId emberId, int bits ) : byte
GetLengthFromShift8Bit ( int shift ) : int
GetLengthLength ( int length, int &shift ) : int
Write7Bit ( WriteBuffer writeBuffer, long value, int shift ) : void
Write8Bit ( WriteBuffer writeBuffer, long value, int shift ) : void
WriteIdentifier ( WriteBuffer writeBuffer, EmberId emberId ) : void

See "X.690"X.690, chapter 8.1.2.

WriteIdentifiersAndLengths ( EmberId outer, EmberId inner, int innerLength ) : void
WriteLength ( WriteBuffer writeBuffer, int length, int shift, int lengthLength ) : void

See "X.690"X.690, chapter 8.1.3.

WriteReal ( WriteBuffer writeBuffer, double value ) : void

See "X.690"X.690, chapter 8.5 and IEEE Floating-Point Representation. Of course the assumption is that C# has the same floating point representation as C++ (pretty safe, as floating point calculations are done by the hardware).

Method Details

EmberWriter() public method

Initializes a new instance of the EmberWriter class by calling EmberWriter(Stream, int)">EmberWriter(
public EmberWriter ( Stream stream ) : System
stream Stream
return System

EmberWriter() public method

Initializes a new instance of the EmberWriter class.
equals null. is 0 or negative.
public EmberWriter ( Stream stream, int bufferSize ) : System
stream Stream The stream to which the EmBER-encoded output should be written.
bufferSize int The size of the internal buffer in bytes.
return System

Flush() public method

Flushes the internal buffer into the stream passed to the constructor.
public Flush ( ) : void
return void

WriteEndContainer() public method

Writes the end of the previous sequence, set or application-defined type.
has been called.
public WriteEndContainer ( ) : void
return void

WriteStartApplicationDefinedType() public method

Writes outer with indefinite length followed by the start of an application-defined type with indefinite length.
is smaller than /// . has been called.
public WriteStartApplicationDefinedType ( EmberId outer, int innerNumber ) : void
outer EmberId
innerNumber int
return void

WriteStartSequence() public method

Writes outer with indefinite length followed by the start of a sequence with indefinite length.
has been called.
public WriteStartSequence ( EmberId outer ) : void
outer EmberId
return void

WriteStartSet() public method

Writes outer with indefinite length followed by the start of a set with indefinite length.
has been called.
public WriteStartSet ( EmberId outer ) : void
outer EmberId
return void

WriteValue() public method

Writes outer with definite length followed by value as Boolean.
has been called.
public WriteValue ( EmberId outer, bool value ) : void
outer EmberId
value bool
return void

WriteValue() public method

Writes outer with definite length followed by value as Octetstring.
has been called.
public WriteValue ( EmberId outer, byte value ) : void
outer EmberId
value byte
return void

WriteValue() public method

Writes outer with definite length followed by value as Real.
This method is called on a big endian CPU, which is currently not /// supported. has been called.
public WriteValue ( EmberId outer, double value ) : void
outer EmberId
value double
return void

WriteValue() public method

Writes outer with definite length followed by value as Relative object identifier.
equals null. has been called.
public WriteValue ( EmberId outer, int value ) : void
outer EmberId
value int
return void

WriteValue() public method

Writes outer with definite length followed by value as Integer.
has been called.
public WriteValue ( EmberId outer, long value ) : void
outer EmberId
value long
return void

WriteValue() public method

Writes outer with definite length followed by value as UTF8String.
equals null. has been called.
public WriteValue ( EmberId outer, string value ) : void
outer EmberId
value string
return void