ENet Class Library for C#

Packet.Insert Method

Inserts a byte in the packet.

[Visual Basic]
Public NotOverridable Sub Insert( _
   ByVal index As Integer, _
   ByVal value As Byte _
) _
    Implements IList<byte>.Insert
[C#]
public void Insert(
   int index,
   byte value
);

Parameters

index
The index to insert at.
value
The value of the byte.

Implements

IList<byte>.Insert

Remarks

Packet resizing behavior is less than optimal. So, in performance-critical applications, it's presently a good idea to initialize the packet with a final byte array instead of using this method.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException index is out of range.
InvalidOperationException The packet is not initialized.

See Also

Packet Class | ENet Namespace