ENet Class Library for C#

Packet.Add Method

Adds a byte to the end of the packet.

[Visual Basic]
Public NotOverridable Sub Add( _
   ByVal value As Byte _
) _
    Implements ICollection<byte>.Add
[C#]
public void Add(
   byte value
);

Parameters

value
The value of the byte.

Implements

ICollection<byte>.Add

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
InvalidOperationException The packet is not initialized.

See Also

Packet Class | ENet Namespace