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: 19.00.00
Syntax
C#
public abstract class PacketReader : PacketIO, 
	IPacketReader, IPacketIO, IDataIO, IBufferReader, IDataReader, 
	IOffsetDataReader, IDataReferenceReader, 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 (or null). Only returns a stream if the underlying data source is a 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. Returning false does not necessarily mean that data is not available. It may be that it's not possible to detect data.
Public propertyEndian Endianess for integral types.
(Inherited from PacketIO)
Public propertyID Optional ID to identify the packet (eg source/destination, packet section, etc).
(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)
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.
Public methodConsume Returns a new packet pointing to the next length bytes, and advances the current packet position. Implies Ensure(length).
Public methodStatic memberCreate(ArraySegmentByte, Endian, BinaryTextEncoding, String) Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(Byte, Endian, BinaryTextEncoding, String) Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(PacketReaderPacketIOMethods, Endian, BinaryTextEncoding, String) Creates a PacketReader.
Public methodStatic memberCreate(Stream, Endian, BinaryTextEncoding, String) Creates a PacketReader from a stream of data. The underlying stream is left open when the PacketReader is closed.
Public methodStatic memberCreate(ArraySegmentByte, Int32, Int32, Endian, BinaryTextEncoding, String) Creates a fixed size PacketReader from a buffer of data.
Public methodStatic memberCreate(Byte, Int32, Int32, Endian, BinaryTextEncoding, String) Creates a fixed size PacketReader from a buffer of data.
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)
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.
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).
Public methodPrune Declare that we'll not want to read length bytes again, allowing the packet to free memory. Advances ValidFrom by length bytes.
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
Extension Methods
 NameDescription
Public Extension MethodConsume Returns a new data reader pointing to the next length bytes, and advances the current packet position. Implies EnsureAsync(length).
(Defined by DataReaderExtensions)
Public Extension MethodGetString Reads a string from the current position in the packet packet. The current position is advanced by the number of bytes read.
(Defined by PacketReaderExtensions)
Public Extension MethodGetString Reads a string from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodPeek Returns a new packet pointing to the next length bytes, but does not advance the current packet position. Implies EnsureAsync(length).
(Defined by DataReaderExtensions)
Public Extension MethodReadBit Reads a bit from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions)
Public Extension MethodReadBit Reads a bit at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadBoolean Reads a boolean from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions)
Public Extension MethodReadBoolean Reads a boolean at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadByte Reads a byte from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions)
Public Extension MethodReadByte Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadBytes Reads a number of bytes from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadBytes Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadChar Reads a character from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions)
Public Extension MethodReadChar Reads a character at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadDouble Reads a 64bit double floating point number from the current position in the packet packet. The current position is advanced by 8 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadDouble Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadDouble Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadDoubleBE Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadDoubleBE Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadDoubleLE Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadDoubleLE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadInt16 Reads a 16bit signed integer from the current position in the packet packet. The current position is advanced by 2 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadInt16 Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt16 Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt16BE Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt16BE Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt16LE Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt16LE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadInt32 Reads a 32bit signed integer from the current position in the packet packet. The current position is advanced by 4 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadInt32 Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt32 Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt32BE Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt32BE Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt32LE Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt32LE Reads the memory exchange from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadInt64 Reads a 64bit signed integer from the current position in the packet packet. The current position is advanced by 8 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadInt64 Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt64 Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt64BE Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt64BE Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadInt64LE Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadInt64LE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadSByte Reads a signed byte from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions)
Public Extension MethodReadSByte Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadSingle Reads a 32bit single floating point number from the current position in the packet packet. The current position is advanced by 4 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadSingle Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadSingle Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadSingleBE Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadSingleBE Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadSingleLE Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadSingleLE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadString Reads a string from the current position in the packet packet. The current position is advanced by the number of bytes read.
(Defined by PacketReaderExtensions)
Public Extension MethodReadString Reads a string from the current position in the buffer. The current position is advanced by the number of bytes read.
(Defined by DataReaderExtensions)
Public Extension MethodReadString Reads a string at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt16 Reads a 16bit unsigned integer from the current position in the packet packet. The current position is advanced by 2 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadUInt16 Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt16 Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt16BE Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt16BE Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt16LE Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt16LE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadUInt32 Reads a 32bit unsigned integer from the current position in the packet packet. The current position is advanced by 4 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadUInt32 Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt32 Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt32BE Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt32BE Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt32LE Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt32LE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Public Extension MethodReadUInt64 Reads a 64bit unsigned integer from the current position in the packet packet. The current position is advanced by 8 bytes.
(Defined by PacketReaderExtensions)
Public Extension MethodReadUInt64 Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt64 Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt64BE Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt64BE Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions)
Public Extension MethodReadUInt64LE Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions)
Public Extension MethodReadUInt64LE Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions)
Top
See Also