using System.Text; namespace Uwaa.HTTP.Websockets; public readonly struct DataFrame { public readonly WSOpcode Opcode; public readonly bool EndOfMessage; public readonly ArraySegment Payload; public DataFrame(WSOpcode opcode, bool endOfMessage, ArraySegment payload) { Opcode = opcode; EndOfMessage = endOfMessage; Payload = payload; } public string AsString() { return Encoding.UTF8.GetString(Payload); } }