public SendItemAsync ( |
||
stream | ||
version | int | |
return | System.Threading.Tasks.Task |
public async Task SendItemAsync(BigEndianStream stream, int version)
{
if (stream == null)
throw new ArgumentNullException("stream");
if (Data != null && !Changed && stream.BufferEnabled)
{
await stream.WriteAsync(Data.ToArray (), 0, Data.Count ());
}
else
await OnSendAsync(stream, version);
await stream.FlushAsync ();
}
}
public static Task WritePacketAsync(this BigEndianStream stream, Packet packet, int version) { if (packet == null) throw new ArgumentNullException("packet"); return packet.SendItemAsync(stream, version); }