C# 클래스 Lawo.EmberPlusSharp.Ember.EmberReader

Represents a reader that provides the means to read BER-encoded input, as specified in "X.690"X.690.
Only the subset defined in the "Ember+ Specification"Ember+ Specification is supported.
상속: IDisposable
파일 보기 프로젝트 열기: Lawo/ember-plus-sharp 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AssertCanReadContents void
AssertNotDisposed void
AssertRead void
CopyCore object
CreateEmberException EmberException
CreateEmberException EmberException
Dispose void
IsContainer bool
ProcessOuter bool
Read7Bit int
Read8Bit long
ReadAndProcessInner void
ReadAndProcessLength void
ReadCore bool
ReadIdentifier EmberId
ReadLength int?
ReadReal double
SkipCore void
ValidateIdentifierAndLength int

공개 메소드들

메소드 설명
Copy ( EmberWriter writer ) : object

Reads the current data value and writes it to writer.

If the EmberReader instance is currently placed on the start of a container, then skips to the end of the container, such that calling Read afterwards will place the reader on either a sibling of the container, the end of the parent container or the end of the stream.

This method has no effect, if the reader is currently placed on a data value with primitive encoding (the next call to Read will skip possibly unread contents anyway).

CopyToEndContainer ( EmberWriter writer, EmberId outerId ) : object

Reads data and writes it to writer until the end of the current container is reached.

While Read returns true and InnerNumber is not equal to Ember.InnerNumber.EndContainer, calls Copy.

EmberReader ( Stream stream ) : System

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

EmberReader ( Stream stream, int bufferSize ) : System

Initializes a new instance of the EmberReader class.

Read ( ) : bool

Advances the reader to the next data value in the stream.

After this method returns true, client code usually examines the values of the EmberReader.InnerNumber and OuterId properties to determine the next steps. This method returns true in the following situations: The identifiers and lengths of a data value with primitive encoding have been read successfully. Call the appropriate ReadContents method to retrieve the contents of the data value. The identifiers and lengths of a sequence, a set or an application-defined type have been read successfully. Call Read to advance the reader to the data values of the container. The reader has read past the end of a sequence, a set or an application-defined type with definite length. Call Read to advance the reader to the data values located after the container. The End-of-contents marker of a sequence, a set or an application-defined type with indefinite length has been read successfully. Call Read to advance the reader to the data values located after the container.

When a EmberReader is first created and initialized, there is no information available. You must call Read to read the first data value.

Possibly unread contents of the previous data value with primitive encoding is skipped automatically.

ReadContentsAsBoolean ( ) : bool

Reads the contents of the current data value as a bool.

ReadContentsAsByteArray ( ) : byte[]

Reads the contents of the current data value as a byte array.

ReadContentsAsDouble ( ) : double

Reads the contents of the current data value as a double.

ReadContentsAsInt32Array ( ) : int[]

Reads the contents of the current data value as an int array.

ReadContentsAsInt64 ( ) : long

Reads the contents of the current data value as a long.

ReadContentsAsObject ( ) : object

Reads the contents of the current data value.

ReadContentsAsString ( ) : string

Reads the contents of the current data value as a string.

Skip ( ) : void

Skips the contents of the current data value.

If the EmberReader instance is currently placed on the start of a container, then skips to the end of the container, such that calling Read afterwards will place the reader on either a sibling of the container, the end of the parent container or the end of the stream.

This method has no effect, if the reader is currently placed on a data value with primitive encoding (the next call to Read will skip possibly unread contents anyway).

SkipToEndContainer ( ) : void

Skips to the end of the current container.

While Read returns true and InnerNumber is not equal to Ember.InnerNumber.EndContainer, calls Skip.

비공개 메소드들

메소드 설명
AssertCanReadContents ( int expectedInnerNumber ) : void
AssertNotDisposed ( ) : void
AssertRead ( ) : void
CopyCore ( EmberWriter writer, int inner ) : object
CreateEmberException ( EndOfStreamException ex ) : EmberException
CreateEmberException ( string format ) : EmberException
Dispose ( ) : void
IsContainer ( PositionInfo position ) : bool
ProcessOuter ( EmberId id, long idPosition ) : bool
Read7Bit ( ReadBuffer readBuffer ) : int
Read8Bit ( ReadBuffer readBuffer, int length, bool isSigned ) : long
ReadAndProcessInner ( ) : void
ReadAndProcessLength ( EmberId id, bool isInner ) : void
ReadCore ( ) : bool
ReadIdentifier ( ReadBuffer readBuffer ) : EmberId

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

ReadLength ( ReadBuffer readBuffer ) : int?

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

ReadReal ( ReadBuffer readBuffer, int length ) : double

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).

SkipCore ( int inner ) : void
ValidateIdentifierAndLength ( EmberId innerIdentifier, long innerIdentifierPosition ) : int

메소드 상세

Copy() 공개 메소드

Reads the current data value and writes it to writer.

If the EmberReader instance is currently placed on the start of a container, then skips to the end of the container, such that calling Read afterwards will place the reader on either a sibling of the container, the end of the parent container or the end of the stream.

This method has no effect, if the reader is currently placed on a data value with primitive encoding (the next call to Read will skip possibly unread contents anyway).

/// /// has never been called, or /// The last call returned false or threw an exception. /// has been called.
public Copy ( EmberWriter writer ) : object
writer EmberWriter
리턴 object

CopyToEndContainer() 공개 메소드

Reads data and writes it to writer until the end of the current container is reached.

While Read returns true and InnerNumber is not equal to Ember.InnerNumber.EndContainer, calls Copy.

has been called.
public CopyToEndContainer ( EmberWriter writer, EmberId outerId ) : object
writer EmberWriter
outerId EmberId
리턴 object

EmberReader() 공개 메소드

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

EmberReader() 공개 메소드

Initializes a new instance of the EmberReader class.
equals null. is 0 or negative.
public EmberReader ( Stream stream, int bufferSize ) : System
stream Stream The stream from which the EmBER-encoded input will be read.
bufferSize int The size of the internal buffer in bytes.
리턴 System

Read() 공개 메소드

Advances the reader to the next data value in the stream.

After this method returns true, client code usually examines the values of the EmberReader.InnerNumber and OuterId properties to determine the next steps. This method returns true in the following situations: The identifiers and lengths of a data value with primitive encoding have been read successfully. Call the appropriate ReadContents method to retrieve the contents of the data value. The identifiers and lengths of a sequence, a set or an application-defined type have been read successfully. Call Read to advance the reader to the data values of the container. The reader has read past the end of a sequence, a set or an application-defined type with definite length. Call Read to advance the reader to the data values located after the container. The End-of-contents marker of a sequence, a set or an application-defined type with indefinite length has been read successfully. Call Read to advance the reader to the data values located after the container.

When a EmberReader is first created and initialized, there is no information available. You must call Read to read the first data value.

Possibly unread contents of the previous data value with primitive encoding is skipped automatically.

An error occurred while parsing the EmBER-encoded data, see /// for more information. has been called.
public Read ( ) : bool
리턴 bool

ReadContentsAsBoolean() 공개 메소드

Reads the contents of the current data value as a bool.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , /// or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsBoolean ( ) : bool
리턴 bool

ReadContentsAsByteArray() 공개 메소드

Reads the contents of the current data value as a byte array.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , /// or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsByteArray ( ) : byte[]
리턴 byte[]

ReadContentsAsDouble() 공개 메소드

Reads the contents of the current data value as a double.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsDouble ( ) : double
리턴 double

ReadContentsAsInt32Array() 공개 메소드

Reads the contents of the current data value as an int array.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to /// , or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsInt32Array ( ) : int[]
리턴 int[]

ReadContentsAsInt64() 공개 메소드

Reads the contents of the current data value as a long.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsInt64 ( ) : long
리턴 long

ReadContentsAsObject() 공개 메소드

Reads the contents of the current data value.
/// /// The value of equals false, or /// One of the ReadContents methods has already been called for the current data value. /// /// has been called.
public ReadContentsAsObject ( ) : object
리턴 object

ReadContentsAsString() 공개 메소드

Reads the contents of the current data value as a string.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , /// or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsString ( ) : string
리턴 string

Skip() 공개 메소드

Skips the contents of the current data value.

If the EmberReader instance is currently placed on the start of a container, then skips to the end of the container, such that calling Read afterwards will place the reader on either a sibling of the container, the end of the parent container or the end of the stream.

This method has no effect, if the reader is currently placed on a data value with primitive encoding (the next call to Read will skip possibly unread contents anyway).

/// /// has never been called, or /// The last call returned false or threw an exception. /// has been called.
public Skip ( ) : void
리턴 void

SkipToEndContainer() 공개 메소드

Skips to the end of the current container.

While Read returns true and InnerNumber is not equal to Ember.InnerNumber.EndContainer, calls Skip.

has been called.
public SkipToEndContainer ( ) : void
리턴 void