initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Crysome.Common.Network.Packets.Client;
|
||||
|
||||
public class AudioDataPacket : IPacket
|
||||
{
|
||||
public byte[] WavData { get; set; }
|
||||
|
||||
public AudioDataPacket()
|
||||
{
|
||||
}
|
||||
|
||||
public AudioDataPacket(byte[] wavData)
|
||||
{
|
||||
WavData = wavData;
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter w)
|
||||
{
|
||||
w.Write((WavData != null) ? WavData.Length : 0);
|
||||
if (WavData != null && WavData.Length != 0)
|
||||
{
|
||||
w.Write(WavData);
|
||||
}
|
||||
}
|
||||
|
||||
public void Read(BinaryReader r)
|
||||
{
|
||||
int num = r.ReadInt32();
|
||||
WavData = ((num > 0) ? r.ReadBytes(num) : new byte[0]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user