You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Network/FileTransfer/Model/FileFrame.cs

37 lines
1.1 KiB

6 years ago
using ZeroLevel.Services.Serialization;
6 years ago
namespace ZeroLevel.Network.FileTransfer
6 years ago
{
public sealed class FileFrame :
6 years ago
IBinarySerializable, IFileTransferInfo
6 years ago
{
6 years ago
public FileTransferInfoType TransferInfoType => FileTransferInfoType.Frame;
public long UploadFileTaskId { get; set; }
6 years ago
public long Offset { get; set; }
public byte[] Payload { get; set; }
public ulong ChecksumL { get; set; }
public ulong ChecksumH { get; set; }
6 years ago
public void Serialize(IBinaryWriter writer)
{
6 years ago
writer.WriteLong(this.UploadFileTaskId);
6 years ago
writer.WriteLong(this.Offset);
writer.WriteBytes(this.Payload);
writer.WriteULong(this.ChecksumL);
writer.WriteULong(this.ChecksumH);
6 years ago
}
public void Deserialize(IBinaryReader reader)
{
6 years ago
this.UploadFileTaskId = reader.ReadLong();
6 years ago
this.Offset = reader.ReadLong();
this.Payload = reader.ReadBytes();
this.ChecksumL = reader.ReadULong();
this.ChecksumH = reader.ReadULong();
6 years ago
}
}
}

Powered by TurnKey Linux.