EonaCat.Network/EonaCat.Network/System/Quic/Infrastructure/Frames/MaxDataFrame.cs

31 lines
883 B
C#

using EonaCat.Quic.Helpers;
using System.Collections.Generic;
namespace EonaCat.Quic.Infrastructure.Frames
{
public class MaxDataFrame : Frame
{
// This file is part of the EonaCat project(s) which is released under the Apache License.
// Copyright EonaCat (Jeroen Saey)
// See file LICENSE or go to https://EonaCat.com/License for full license details.
public override byte Type => 0x10;
public IntegerVar MaximumData { get; set; }
public override void Decode(ByteArray array)
{
array.ReadByte();
MaximumData = array.ReadIntegerVar();
}
public override byte[] Encode()
{
List<byte> result = new List<byte>();
result.Add(Type);
result.AddRange(MaximumData.ToByteArray());
return result.ToArray();
}
}
}