PacketWriter Methods |
The PacketWriter type exposes the following members.
| Name | Description | |
|---|---|---|
| Advance |
Advances the current packet position. Implies Ensure(length).
(Inherited from PacketIO.) | |
| Clear |
Remove all data from the packet so it can be re-written.
| |
| Create(Endian, BinaryTextEncoding) |
Creates an expandable PacketWriter. The packet will expand to accomodate the data written into it.
| |
| Create(Byte, Endian, BinaryTextEncoding) |
Creates a fixed size PacketWriter from a buffer of data.
| |
| Create(Int32, Endian, BinaryTextEncoding) |
Creates a fixed size PacketWriter from a buffer of data.
| |
| Create(Buffer, Endian, BinaryTextEncoding) |
Creates a fixed size PacketWriter from a buffer of data.
| |
| Create(PacketWriterPacketIOMethods, Endian, BinaryTextEncoding) |
Creates a PacketWriter.
| |
| Create(Stream, PacketLock, Endian, BinaryTextEncoding) |
Creates an expandable PacketWriter writing to a data stream. The packet will expand to accomodate the data written into it.
| |
| Create(Byte, Int32, Int32, Endian, BinaryTextEncoding) |
Creates a fixed size PacketWriter from a buffer of data.
| |
| Create(Buffer, Int32, Int32, Endian, BinaryTextEncoding) |
Creates a fixed size PacketWriter from a buffer of data.
| |
| Dispose |
Releases any resources associated with this packet.
| |
| Ensure |
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.) | |
| Flush |
Flush the data to the underlying stream.
| |
| FlushAsync |
Flush the data to the underlying stream.
| |
| GetBuffer |
Get a buffer that covers a specific portion of the packet.
(Inherited from PacketIO.) | |
| GetEndian |
Returns the current endian format.
(Inherited from PacketIO.) | |
| GetTextEncoding |
Returns the current text encoding.
(Inherited from PacketIO.) | |
| Insert |
Returns a new packet pointing to the current position in this packet. Anything written into the new packet
will be inserted into the data buffer when this packet is resolved.
If length is non-negative, then a fixed packet will be returned. Implies Ensure(length).
If this packet is not fixed, and length is negative, then an expandable packet will be returned.
| |
| LengthAfterChild |
Returns the length of the this packet after the end of a given direct child packet position.
(Inherited from PacketIO.) | |
| MarkPosition |
Return a position marker.
(Inherited from PacketIO.) | |
| NotifyAfterResolve |
Fire OnAfterResolve event for this packet and all its descendants.
| |
| NotifyBeforeResolve |
Fire OnBeforeResolve event for this packet and all its descendants.
| |
| PositionOfChild |
Returns the current absolute position of a direct child packet position.
(Inherited from PacketIO.) | |
| ReadBit |
Reads a bit at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadBoolean |
Reads a boolean at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadByte |
Reads a byte at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadBytes(Int32, Buffer) |
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadBytes(Int32, Int32) |
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadBytes(Int32, PacketWriter, Int32) |
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadBytes(Int32, Byte, Int32, Int32) |
Reads a number of bytes at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadChar |
Reads a character at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadDouble |
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadDoubleBE |
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadDoubleLE |
Reads a 64bit double floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt16 |
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt16BE |
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt16LE |
Reads a 16bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt32 |
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt32BE |
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt32LE |
Reads a 32bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt64 |
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt64BE |
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadInt64LE |
Reads a 64bit signed integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadSByte |
Reads a signed byte at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadSingle |
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadSingleBE |
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadSingleLE |
Reads a 32bit single floating point number at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadString(Int32) |
Reads a string at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadString(Int32, BinaryTextEncoding) |
Reads a string at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt16 |
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt16BE |
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt16LE |
Reads a 16bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt32 |
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt32BE |
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt32LE |
Reads a 32bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt64 |
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt64BE |
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| ReadUInt64LE |
Reads a 64bit unsigned integer at offset in the buffer.
(Inherited from PacketIO.) | |
| Reset |
Reset packet (and its ancestor packets) so that it can be resolved and flushed again.
| |
| Resolve |
Resolve this packet into concrete data. Resolve makes two passes across the packet from start to end, depth-first.
The first pass it calls OnBeforeResolve for each constituent packet, and the second pass it calls OnAfterResolve and
collects the data to be returned. You can write to a packet during Resolve.
| |
| ResolveBuffer |
Resolve this packet into concrete data.
| |
| WriteAsDouble |
Writes a 64bit double floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
| |
| WriteAsInt16 |
Writes a 16bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
| |
| WriteAsInt32 |
Writes a 32bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
| |
| WriteAsInt64 |
Writes a 64bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
| |
| WriteAsSingle |
Writes a 32bit single floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
| |
| WriteAsUInt16 |
Writes a 16bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
| |
| WriteAsUInt32 |
Writes a 32bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
| |
| WriteAsUInt64 |
Writes a 64bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
| |
| WriteBit |
Writes a bit at the current position in the packet packet.
The current position is advanced by 1 byte.
| |
| WriteBoolean |
Writes a boolean at the current position in the packet packet.
The current position is advanced by 1 byte.
| |
| WriteByte |
Writes a byte at the current position in the packet packet.
The current position is advanced by 1 byte.
| |
| WriteBytes(Byte) |
Writes a bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteBytes(Int32) |
Prepare a buffer for writing bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteBytes(Buffer) |
Writes a bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteBytes(PacketReader, Int32) |
Writes a bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteBytes(Byte, Int32, Int32) |
Writes a bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteBytes(PacketReader, Int32, Int32) |
Writes a bytes at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteChar |
Writes a character at the current position in the packet packet.
The current position is advanced by 1 byte.
| |
| WriteDouble |
Writes a 64bit double floating point number at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteDoubleBE |
Writes a 64bit double floating point number at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteDoubleLE |
Writes a 64bit double floating point number at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteInt16 |
Writes a 16bit signed integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteInt16BE |
Writes a 16bit signed integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteInt16LE |
Writes a 16bit signed integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteInt32 |
Writes a 32bit signed integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteInt32BE |
Writes a 32bit signed integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteInt32LE |
Writes a 32bit signed integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteInt64 |
Writes a 64bit signed integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteInt64BE |
Writes a 64bit signed integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteInt64LE |
Writes a 64bit signed integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteSByte |
Writes a signed byte at the current position in the packet packet.
The current position is advanced by 1 byte.
| |
| WriteSingle |
Writes a 32bit single floating point number at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteSingleBE |
Writes a 32bit single floating point number at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteSingleLE |
Writes a 32bit single floating point number at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteString(BinaryString) |
Writes a string at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteString(BinaryString, BinaryTextEncoding) |
Writes a string at the current position in the packet packet.
The current position is advanced by the number of bytes written.
| |
| WriteUInt16 |
Writes a 16bit unsigned integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteUInt16BE |
Writes a 16bit unsigned integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteUInt16LE |
Writes a 16bit unsigned integer at the current position in the packet packet.
The current position is advanced by 2 bytes.
| |
| WriteUInt32 |
Writes a 32bit unsigned integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteUInt32BE |
Writes a 32bit unsigned integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteUInt32LE |
Writes a 32bit unsigned integer at the current position in the packet packet.
The current position is advanced by 4 bytes.
| |
| WriteUInt64 |
Writes a 64bit unsigned integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteUInt64BE |
Writes a 64bit unsigned integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
| |
| WriteUInt64LE |
Writes a 64bit unsigned integer at the current position in the packet packet.
The current position is advanced by 8 bytes.
|
| Name | Description | |
|---|---|---|
| WriteAsBit |
Writes a bit at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Boolean).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by DataWriter.) | |
| WriteAsBoolean |
Writes a boolean at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Boolean).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by DataWriter.) | |
| WriteAsByte |
Writes a byte at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Byte).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by DataWriter.) | |
| WriteAsChar |
Writes a character at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Char).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by DataWriter.) | |
| WriteAsDouble |
Writes a 64bit double floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsDoubleBE |
Writes a 64bit double floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsDoubleLE |
Writes a 64bit double floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsInt16 |
Writes a 16bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsInt16BE |
Writes a 16bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsInt16LE |
Writes a 16bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsInt32 |
Writes a 32bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsInt32BE |
Writes a 32bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsInt32LE |
Writes a 32bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsInt64 |
Writes a 64bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsInt64BE |
Writes a 64bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsInt64LE |
Writes a 64bit signed integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsSByte |
Writes a signed byte at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.SByte).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by DataWriter.) | |
| WriteAsSingle |
Writes a 32bit single floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsSingleBE |
Writes a 32bit single floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsSingleLE |
Writes a 32bit single floating point number at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsString |
Writes a string at the current position in the packet packet.
The current position is advanced by the number of bytes written.
(Defined by DataWriter.) | |
| WriteAsUInt16 |
Writes a 16bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt16BE |
Writes a 16bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt16LE |
Writes a 16bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt32 |
Writes a 32bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt32BE |
Writes a 32bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt32LE |
Writes a 32bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt64 |
Writes a 64bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt64BE |
Writes a 64bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) | |
| WriteAsUInt64LE |
Writes a 64bit unsigned integer at the current position in the packet packet.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by DataWriter.) |