ENet Class Library for C#

Packet.Initialize(Byte, Int32, Int32, PacketFlags) Method

Initializes a new packet from data at the given offset, of the given length, and with the given flags.

[Visual Basic]
Public Overloads Sub Initialize( _
   ByVal data As Byte, _
   ByVal offset As Integer, _
   ByVal length As Integer, _
   ByVal flags As PacketFlags _
)
[C#]
public void Initialize(
   byte[] data,
   int offset,
   int length,
   PacketFlags flags
);

Parameters

data
An array containing the data the packet will contain.
offset
The offset of the first byte of data.
length
The length of the data.
flags
The flags the packet will use.

Exceptions

Exception Type Condition
ArgumentNullException data is null.
ArgumentOutOfRangeException offset and/or length are out of range.
InvalidOperationException The packet is already initialized.
ENetException Packet creation failed.

See Also

Packet Class | ENet Namespace | Packet.Initialize Overload List