Click or drag to resize

IPacketReader Interface

Represents a class that can read data from a packet at the current position.

Namespace:  Demo3D.IO
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 15.0.2.11458
Syntax
C#
public interface IPacketReader : IPacketIO, 
	IDataIO, IDataLocationProvider, IBufferReader, IDataReader, IOffsetDataReader, 
	IDataReferenceReader, IDisposable

The IPacketReader type exposes the following members.

Properties
  NameDescription
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 IPacketIO.)
Public propertyID
Optional ID to identify the packet (eg source/destination, packet section, etc).
(Inherited from IPacketIO.)
Public propertyIsFixed
Returns true if this is a fixed size data source.
(Inherited from IDataIO.)
Public propertyLength
Returns the current length of the data.
(Inherited from IDataIO.)
Public propertyParent
Returns the parent packet, or null.
(Inherited from IPacketIO.)
Public propertyPosition
Returns the current position in the data.
(Inherited from IDataIO.)
Public propertyRemaining
Returns the remaining data/space available. (Always 0 for an expandable buffer.)
(Inherited from IDataIO.)
Public propertyTextEncoding
Encoding for text strings.
(Inherited from IPacketIO.)
Top
Methods
  NameDescription
Public methodAdvance
Advances the current data position..
(Inherited from IDataIO.)
Public methodClose
Closes the current reader and closes access to the underlying stream.
Public methodConsume
Returns a new packet reader pointing to the next length bytes, and advances the current packet position. Implies Ensure(length).
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.
(Inherited from IDataReader.)
Public methodGetDataLocation
Gets the current location in a data source.
(Inherited from IDataLocationProvider.)
Public methodGetReferenceT
Returns a reference to data of type T at the specified offset.
(Inherited from IDataReferenceReader.)
Public methodMarkPosition
Return a position marker.
(Inherited from IPacketIO.)
Public methodPeek
Returns a new packet reader pointing to the next length bytes, but does not advance the current packet position. Implies Ensure(length).
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 MethodGetStringOverloaded.
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(BinaryTextEncoding)Overloaded.
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(Int32)Overloaded.
Reads a bit from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions.)
Public Extension MethodReadBit(Int32, Int32)Overloaded.
Reads a bit at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadBooleanOverloaded.
Reads a boolean from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions.)
Public Extension MethodReadBoolean(Int32)Overloaded.
Reads a boolean at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadByteOverloaded.
Reads a byte from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions.)
Public Extension MethodReadByte(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadBytes(ArraySegmentByte)Overloaded.
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(Int32)Overloaded.
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(IDataWriter, Int32)Overloaded.
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(Int32, Int32)Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadBytes(Int32, ArraySegmentByte)Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadBytes(ArraySegmentByte, Int32, Int32)Overloaded.
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(Byte, Int32, Int32)Overloaded.
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(Int32, IDataWriter, Int32)Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadBytes(Int32, Byte, Int32, Int32)Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadCharOverloaded.
Reads a character from the current position in the buffer. The current position is advanced by 1 byte.
(Defined by DataReaderExtensions.)
Public Extension MethodReadChar(Int32)Overloaded.
Reads a character at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadDoubleOverloaded.
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(Endian)Overloaded.
Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadDouble(Int32, Endian)Overloaded.
Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadDoubleBEOverloaded.
Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadDoubleBE(Int32)Overloaded.
Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadDoubleLEOverloaded.
Reads a 64bit double floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadDoubleLE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadInt16Overloaded.
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(Endian)Overloaded.
Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt16(Int32, Endian)Overloaded.
Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt16BEOverloaded.
Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt16BE(Int32)Overloaded.
Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt16LEOverloaded.
Reads a 16bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt16LE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadInt32Overloaded.
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(Endian)Overloaded.
Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt32(Int32, Endian)Overloaded.
Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt32BEOverloaded.
Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt32BE(Int32)Overloaded.
Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt32LEOverloaded.
Reads a 32bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt32LE(Int32)Overloaded.
Reads the memory exchange from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadInt64Overloaded.
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(Endian)Overloaded.
Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt64(Int32, Endian)Overloaded.
Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt64BEOverloaded.
Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt64BE(Int32)Overloaded.
Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadInt64LEOverloaded.
Reads a 64bit signed integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadInt64LE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadSByteOverloaded.
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(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadSingleOverloaded.
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(Endian)Overloaded.
Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadSingle(Int32, Endian)Overloaded.
Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadSingleBEOverloaded.
Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadSingleBE(Int32)Overloaded.
Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadSingleLEOverloaded.
Reads a 32bit single floating point number at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadSingleLE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadStringOverloaded.
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(BinaryTextEncoding)Overloaded.
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(Int32, BinaryTextEncoding)Overloaded.
Reads a string at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt16Overloaded.
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(Endian)Overloaded.
Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt16(Int32, Endian)Overloaded.
Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt16BEOverloaded.
Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt16BE(Int32)Overloaded.
Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt16LEOverloaded.
Reads a 16bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt16LE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadUInt32Overloaded.
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(Endian)Overloaded.
Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt32(Int32, Endian)Overloaded.
Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt32BEOverloaded.
Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt32BE(Int32)Overloaded.
Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt32LEOverloaded.
Reads a 32bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt32LE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Public Extension MethodReadUInt64Overloaded.
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(Endian)Overloaded.
Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt64(Int32, Endian)Overloaded.
Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt64BEOverloaded.
Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt64BE(Int32)Overloaded.
Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.)
Public Extension MethodReadUInt64LEOverloaded.
Reads a 64bit unsigned integer at the current position in the buffer.
(Defined by DataReaderExtensions.)
Public Extension MethodReadUInt64LE(Int32)Overloaded.
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.)
Top
See Also