Click or drag to resize

PacketReader Class

Represents a packet reader/dissector.
Inheritance Hierarchy
SystemObject
  Demo3D.IOPacketPosition
    Demo3D.IOPacketIO
      Demo3D.IOPacketReader

Namespace:  Demo3D.IO
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 11.0.0.7658
Syntax
C#
public abstract class PacketReader : PacketIO, 
	IDataReader, IDisposable

The PacketReader type exposes the following members.

Constructors
  NameDescription
Protected methodPacketReader
Creates a new packet reader.
Top
Properties
  NameDescription
Public propertyBaseStream
Exposes access to the underlying stream.
Public propertyDataAvailable
Returns true if data is immediately available. (Specifically that EnsureAsync(1) won't block.) Returns true if there's any data remaining in the packet (this.Remaining > 0), or if the underlying stream has data available.
Public propertyDataLengthOfParent
Returns the length in bytes from this position to the current parent packet Position. For a PacketReader this is the length from this PacketPosition to our parents current Position. For a PacketWriter it's the length from this PacketPosition to the end of our Parent packet.
(Inherited from PacketPosition.)
Public propertyEndian
Endianess for integral types.
(Inherited from PacketIO.)
Public propertyID
Optional ID used in error messages.
(Inherited from PacketIO.)
Public propertyIsFixed
Returns true if this is a fixed size packet. Ensure can't expand a fixed packet.
(Inherited from PacketIO.)
Public propertyLength
Returns the current length of the packet.
(Overrides PacketIOLength.)
Protected propertyLengthToCurrentPositionOfParent
Returns the length in bytes from this position to the current position of our parent packet.
(Inherited from PacketPosition.)
Protected propertyLengthToEndOfParent
Returns the length in bytes from this position to the end of our parent packet.
(Inherited from PacketIO.)
Public propertyParent
Returns the parent packet, or null.
(Inherited from PacketPosition.)
Public propertyPosition
Returns the current position in the packet.
(Overrides PacketIOPosition.)
Public propertyPositionInParent
Returns the current position with respect to our parent packet.
(Inherited from PacketIO.)
Public propertyRemaining
Returns the remaining data/space available in the packet. If it's a fixed-size packet, then this is definitive. Otherwise Ensure can be used to try to extend the packet with more data/space.
(Overrides PacketIORemaining.)
Public propertyTextEncoding
Encoding for text strings.
(Inherited from PacketIO.)
Public propertyTop
Returns the top parent.
(Inherited from PacketIO.)
Public propertyValidFrom
Returns the low water mark of the packet. Data prior to this mark may have been discarded and cannot be read.
Top
Methods
  NameDescription
Public methodAdvance
Advances the current packet position. Implies Ensure(length).
(Inherited from PacketIO.)
Public methodClose
Closes the current reader and closes access to the underlying stream.
Protected methodClosePacket
Close access to any associated data stream.
Public methodConsume
Returns a new packet pointing to the next length bytes, and advances the current packet position. Implies Ensure(length).
Public methodStatic memberCreate(Byte, Endian, BinaryTextEncoding)
Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(Buffer, Endian, BinaryTextEncoding)
Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(Stream, Endian, BinaryTextEncoding, IEnumerableBuffer)
Creates a PacketReader from a stream of data. The underlying stream is left open when the PacketReader is closed.
Public methodStatic memberCreate(PacketReaderPacketIOMethods, Endian, BinaryTextEncoding, IEnumerableBuffer)
Creates a PacketReader.
Public methodStatic memberCreate(Byte, Int32, Int32, Endian, BinaryTextEncoding)
Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(Stream, PacketKey, Endian, BinaryTextEncoding, IEnumerableBuffer)
Creates a PacketReader from a stream of data. The underlying stream is left open when the PacketReader is closed.
Public methodStatic memberCreate(Buffer, Int32, Int32, Endian, BinaryTextEncoding)
Creates a fixed size PacketReader from a buffer of data.
Public methodDispose
Closes the current reader and closes access to the underlying stream.
Public methodEnsure
Ensure that the next length bytes of data/space are available in the packet. If there isn't enough already available, and the packet isn't fixed, then it'll attempt to read more data into or create more space in the packet.
(Inherited from PacketIO.)
Protected methodEnsureAdditionalDataAsync
Wait for at least length additional data to become available.
Public methodEnsureAsync
Ensure that the next length bytes of data is available in the packet. If there isn't enough already available, and the packet isn't fixed, then it'll attempt to read more data into the packet.
Protected methodGetBuffer
Get a buffer that covers a specific portion of the packet.
(Inherited from PacketIO.)
Protected methodGetEndian
Returns the current endian format.
(Inherited from PacketIO.)
Protected methodGetTextEncoding
Returns the current text encoding.
(Inherited from PacketIO.)
Protected methodLengthAfterChild
Returns the length of the this packet after the end of a given direct child packet position.
(Overrides PacketIOLengthAfterChild(PacketIO).)
Public methodMarkPosition
Return a position marker.
(Overrides PacketIOMarkPosition.)
Public methodPeek
Returns a new packet pointing to the next length bytes, but does not advance the current packet position. Implies Ensure(length).
Protected methodPositionOfChild
Returns the current absolute position of a direct child packet position.
(Overrides PacketIOPositionOfChild(PacketIO).)
Public methodPrune
Declare that we'll not want to read length bytes again, allowing the packet to free memory. Advances ValidFrom by length bytes.
Public methodReadBit(Int32)
Reads a bit from the current position in the packet packet. The current position is advanced by 1 byte.
Public methodReadBit(Int32, Int32)
Reads a bit at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadBoolean
Reads a boolean from the current position in the packet packet. The current position is advanced by 1 byte.
Public methodReadBoolean(Int32)
Reads a boolean at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadByte
Reads a byte from the current position in the packet packet. The current position is advanced by 1 byte.
Public methodReadByte(Int32)
Reads a byte at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadBytes(Int32)
Reads a number of bytes from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadBytes(Buffer)
Reads a number of bytes from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadBytes(Int32, Buffer)
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadBytes(Int32, Int32)
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadBytes(PacketWriter, Int32)
Reads a number of bytes from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadBytes(Int32, PacketWriter, Int32)
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadBytes(Byte, Int32, Int32)
Reads a number of bytes from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadBytes(Int32, Byte, Int32, Int32)
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadChar
Reads a character from the current position in the packet packet. The current position is advanced by 1 byte.
Public methodReadChar(Int32)
Reads a character at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadDouble(Endian)
Reads a 64bit double floating point number from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadDouble(Int32, Endian)
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadDoubleBE
Reads a 64bit double floating point number from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadDoubleBE(Int32)
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadDoubleLE
Reads a 64bit double floating point number from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadDoubleLE(Int32)
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt16(Endian)
Reads a 16bit signed integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadInt16(Int32, Endian)
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt16BE
Reads a 16bit signed integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadInt16BE(Int32)
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt16LE
Reads a 16bit signed integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadInt16LE(Int32)
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt32(Endian)
Reads a 32bit signed integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadInt32(Int32, Endian)
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt32BE
Reads a 32bit signed integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadInt32BE(Int32)
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt32LE
Reads a 32bit signed integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadInt32LE(Int32)
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt64(Endian)
Reads a 64bit signed integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadInt64(Int32, Endian)
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt64BE
Reads a 64bit signed integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadInt64BE(Int32)
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadInt64LE
Reads a 64bit signed integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadInt64LE(Int32)
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadSByte
Reads a signed byte from the current position in the packet packet. The current position is advanced by 1 byte.
Public methodReadSByte(Int32)
Reads a signed byte at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadSingle(Endian)
Reads a 32bit single floating point number from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadSingle(Int32, Endian)
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadSingleBE
Reads a 32bit single floating point number from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadSingleBE(Int32)
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadSingleLE
Reads a 32bit single floating point number from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadSingleLE(Int32)
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadString
Reads a string from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadString(Int32)
Reads a string at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadString(BinaryTextEncoding)
Reads a string from the current position in the packet packet. The current position is advanced by the number of bytes read.
Public methodReadString(Int32, BinaryTextEncoding)
Reads a string at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt16(Endian)
Reads a 16bit unsigned integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadUInt16(Int32, Endian)
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt16BE
Reads a 16bit unsigned integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadUInt16BE(Int32)
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt16LE
Reads a 16bit unsigned integer from the current position in the packet packet. The current position is advanced by 2 bytes.
Public methodReadUInt16LE(Int32)
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt32(Endian)
Reads a 32bit unsigned integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadUInt32(Int32, Endian)
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt32BE
Reads a 32bit unsigned integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadUInt32BE(Int32)
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt32LE
Reads a 32bit unsigned integer from the current position in the packet packet. The current position is advanced by 4 bytes.
Public methodReadUInt32LE(Int32)
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt64(Endian)
Reads a 64bit unsigned integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadUInt64(Int32, Endian)
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt64BE
Reads a 64bit unsigned integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadUInt64BE(Int32)
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Public methodReadUInt64LE
Reads a 64bit unsigned integer from the current position in the packet packet. The current position is advanced by 8 bytes.
Public methodReadUInt64LE(Int32)
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.)
Top
Fields
  NameDescription
Protected fieldlength
The length of the packet.
Protected fieldposition
The current position in the packet.
Protected fieldremaining
The number of bytes of data remaining in the packet.
Top
See Also