C# Class DotAmf.Decoder.Amf3Decoder

AMF3 decoder.
Inheritance: Amf0Decoder
ファイルを表示 Open project: artema/DotAmf

Public Methods

Method Description
Amf3Decoder ( AmfEncodingOptions options ) : System
Decode ( Stream stream, XmlWriter output ) : void

Protected Methods

Method Description
ReadAmfValue ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Private Methods

Method Description
ReadArray ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Read an array.

Type declaration: U29A-value = U29 (The first (low) bit is a flag with value 1. The remaining 1 to 28 significant bits are used to encode the count of the dense portion of the Array). assoc-value = UTF-8-vr value-type array-type = array-marker (U29O-ref | (U29A-value (UTF-8-empty | *(assoc-value) UTF-8-empty) *(value-type)))

ReadByteArray ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Read a byte array.

Type declaration: U29B-value = U29 (The first (low) bit is a flag with value 1. The remaining 1 to 28 significant bits are used to encode the byte-length of the ByteArray). bytearray-type = bytearray-marker (U29O-ref | U29B-value *(U8))

ReadDate ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Read a date.

Type declaration: U29D-value = U29 (The first (low) bit is a flag with value 1. The remaining bits are not used). date-time = DOUBLE (A 64-bit integer value transported as a double). date-type = date-marker (U29O-ref | (U29D-value date-time))

ReadDouble ( AmfStreamReader reader, XmlWriter output = null ) : void

Read a double.

ReadInteger ( AmfStreamReader reader, XmlWriter output = null ) : void

Read an integer.

ReadObject ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Read an object.

ReadReference ( AmfContext context, AmfStreamReader reader, int &index, int &reference ) : bool

Read an object reference.

ReadString ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : string

Read a string.

Type declaration: U29S-ref = U29 (The first (low) bit is a flag with value 0. The remaining 1 to 28 significant bits are used to encode a string reference table index (an integer)). U29S-value = U29 (The first (low) bit is a flag with value 1. The remaining 1 to 28 significant bits are used to encode the byte-length of the UTF-8 encoded representation of the string). UTF-8-empty = 0x01 (The UTF-8-vr empty string which is never sent by reference). UTF-8-vr = U29S-ref | (U29S-value *(UTF8-char)) string-type = string-marker UTF-8-vr

ReadStringReference ( AmfContext context, AmfStreamReader reader, int &index, int &reference ) : string

Read a string reference.

ReadTraitsReference ( AmfContext context, AmfStreamReader reader, int &index, int &reference ) : AmfTypeTraits

Read a traits reference.

ReadUint29 ( AmfStreamReader reader ) : int

Read a 29-bit unsigned integer.

Up to 4 bytes are required to hold the value however the high bit of the first 3 bytes are used as flags to determine whether the next byte is part of the integer. 0x00000000 - 0x0000007F : 0xxxxxxx 0x00000080 - 0x00003FFF : 1xxxxxxx 0xxxxxxx 0x00004000 - 0x001FFFFF : 1xxxxxxx 1xxxxxxx 0xxxxxxx 0x00200000 - 0x3FFFFFFF : 1xxxxxxx 1xxxxxxx 1xxxxxxx xxxxxxxx 0x40000000 - 0xFFFFFFFF : throw range exception

ReadUtf8 ( AmfStreamReader reader, int length ) : string

Read a specified number of bytes of a string.

ReadValue ( AmfContext context, AmfStreamReader reader, Amf3TypeMarker type, XmlWriter output = null ) : void

Read a value of a given type from current reader's position.

Current reader position must be just after a value type marker of a type to read.

ReadXml ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void

Read an XML document.

Type declaration: U29X-value = U29 (The first (low) bit is a flag with value 1. The remaining 1 to 28 significant bits are used to encode the byte-length of the UTF-8 encoded representation of the XML or XMLDocument). xml-doc-type = xml-doc-marker (U29O-ref | (U29X-value *(UTF8-char)))

WriteEmptyElement ( string elementName, XmlWriter output ) : void

Write an empty element of a given name.

WriteReference ( int index, XmlWriter output ) : void

Write a reference.

Method Details

Amf3Decoder() public method

public Amf3Decoder ( AmfEncodingOptions options ) : System
options DotAmf.Data.AmfEncodingOptions
return System

Decode() public method

public Decode ( Stream stream, XmlWriter output ) : void
stream Stream
output System.Xml.XmlWriter
return void

ReadAmfValue() protected method

protected ReadAmfValue ( AmfContext context, AmfStreamReader reader, XmlWriter output = null ) : void
context DotAmf.Data.AmfContext
reader DotAmf.IO.AmfStreamReader
output System.Xml.XmlWriter
return void