ENet Class Library for C#

Packet.CopyTo(Byte, Int32, Int32, Int32) Method

Copies part of the packet data into an array.

[Visual Basic]
Public Overloads Sub CopyTo( _
   ByVal array As Byte, _
   ByVal arrayIndex As Integer, _
   ByVal count As Integer, _
   ByVal sourceIndex As Integer _
)
[C#]
public void CopyTo(
   byte[] array,
   int arrayIndex,
   int count,
   int sourceIndex
);

Parameters

array
The array to copy into.
arrayIndex
The target array index at which to begin copying.
count
The number of bytes to copy.
sourceIndex
The index into the packet at which to begin copying.

Exceptions

Exception Type Condition
ArgumentNullException array is null.
ArgumentOutOfRangeException arrayIndex, count, and/or sourceIndex are out of range.
InvalidOperationException The packet is not initialized.

See Also

Packet Class | ENet Namespace | Packet.CopyTo Overload List