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