ENet Class Library for C#

Packet.Initialize(Byte, Int32, Int32) Method

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

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

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.

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