public byte GetMinByteSize() => 84; // of byte sized of fields (exclude extended) public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize) { var index = 0; var endIndex = payloadSize; var arraySize = 0; arraySize = 2; for (var i = 0; i < arraySize; i++) { ArD[i] = BinSerialize.ReadDouble(ref buffer); index += 8; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArF[i] = BinSerialize.ReadFloat(ref buffer); index += 4; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArU32[i] = BinSerialize.ReadUInt(ref buffer); index += 4; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArI32[i] = BinSerialize.ReadInt(ref buffer); index += 4; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArU16[i] = BinSerialize.ReadUShort(ref buffer); index += 2; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArI16[i] = BinSerialize.ReadShort(ref buffer); index += 2; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArU8[i] = (byte)BinSerialize.ReadByte(ref buffer); index += 1; } arraySize = 2; for (var i = 0; i < arraySize; i++) { ArI8[i] = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1; } arraySize = /*ArrayLength*/ 32 - Math.Max(0, ((/*PayloadByteSize*/ 84 - payloadSize - /*ExtendedFieldsLength*/ 0) / 1 /*FieldTypeByteSize*/)); ArC = new char[arraySize]; unsafe { fixed(byte *bytePointer = buffer) fixed(char *charPointer = ArC) { Encoding.ASCII.GetChars(bytePointer, arraySize, charPointer, ArC.Length); } } buffer = buffer.Slice(arraySize); index += arraySize; }
public byte GetMinByteSize() => 32; // of byte sized of fields (exclude extended) public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize) { var index = 0; var endIndex = payloadSize; var arraySize = 0; Usec = BinSerialize.ReadULong(ref buffer); index += 8; Accel0 = BinSerialize.ReadFloat(ref buffer); index += 4; Accel1 = BinSerialize.ReadFloat(ref buffer); index += 4; Accel2 = BinSerialize.ReadFloat(ref buffer); index += 4; Gyro0 = BinSerialize.ReadFloat(ref buffer); index += 4; Gyro1 = BinSerialize.ReadFloat(ref buffer); index += 4; Gyro2 = BinSerialize.ReadFloat(ref buffer); index += 4; }
public byte GetMinByteSize() => 46; // of byte sized of fields (exclude extended) public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize) { var index = 0; var endIndex = payloadSize; var arraySize = 0; Min1 = BinSerialize.ReadFloat(ref buffer); index += 4; Max1 = BinSerialize.ReadFloat(ref buffer); index += 4; Min2 = BinSerialize.ReadFloat(ref buffer); index += 4; Max2 = BinSerialize.ReadFloat(ref buffer); index += 4; Min3 = BinSerialize.ReadFloat(ref buffer); index += 4; Max3 = BinSerialize.ReadFloat(ref buffer); index += 4; Min4 = BinSerialize.ReadFloat(ref buffer); index += 4; Max4 = BinSerialize.ReadFloat(ref buffer); index += 4; Min5 = BinSerialize.ReadFloat(ref buffer); index += 4; Max5 = BinSerialize.ReadFloat(ref buffer); index += 4; Numbands = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1; Type1 = (IcarousTrackBandTypes)BinSerialize.ReadByte(ref buffer); index += 1; Type2 = (IcarousTrackBandTypes)BinSerialize.ReadByte(ref buffer); index += 1; Type3 = (IcarousTrackBandTypes)BinSerialize.ReadByte(ref buffer); index += 1; Type4 = (IcarousTrackBandTypes)BinSerialize.ReadByte(ref buffer); index += 1; Type5 = (IcarousTrackBandTypes)BinSerialize.ReadByte(ref buffer); index += 1; }
public byte GetMinByteSize() => 179; // of byte sized of fields (exclude extended) public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize) { var index = 0; var endIndex = payloadSize; var arraySize = 0; U64 = BinSerialize.ReadULong(ref buffer); index += 8; S64 = BinSerialize.ReadLong(ref buffer); index += 8; D = BinSerialize.ReadDouble(ref buffer); index += 8; arraySize = /*ArrayLength*/ 3 - Math.Max(0, ((/*PayloadByteSize*/ 179 - payloadSize - /*ExtendedFieldsLength*/ 0) / 8 /*FieldTypeByteSize*/)); U64Array = new ulong[arraySize]; for (var i = 0; i < arraySize; i++) { U64Array[i] = BinSerialize.ReadULong(ref buffer); index += 8; } arraySize = 3; for (var i = 0; i < arraySize; i++) { S64Array[i] = BinSerialize.ReadLong(ref buffer); index += 8; } arraySize = 3; for (var i = 0; i < arraySize; i++) { DArray[i] = BinSerialize.ReadDouble(ref buffer); index += 8; } U32 = BinSerialize.ReadUInt(ref buffer); index += 4; S32 = BinSerialize.ReadInt(ref buffer); index += 4; F = BinSerialize.ReadFloat(ref buffer); index += 4; arraySize = 3; for (var i = 0; i < arraySize; i++) { U32Array[i] = BinSerialize.ReadUInt(ref buffer); index += 4; } arraySize = 3; for (var i = 0; i < arraySize; i++) { S32Array[i] = BinSerialize.ReadInt(ref buffer); index += 4; } arraySize = 3; for (var i = 0; i < arraySize; i++) { FArray[i] = BinSerialize.ReadFloat(ref buffer); index += 4; } U16 = BinSerialize.ReadUShort(ref buffer); index += 2; S16 = BinSerialize.ReadShort(ref buffer); index += 2; arraySize = 3; for (var i = 0; i < arraySize; i++) { U16Array[i] = BinSerialize.ReadUShort(ref buffer); index += 2; } arraySize = 3; for (var i = 0; i < arraySize; i++) { S16Array[i] = BinSerialize.ReadShort(ref buffer); index += 2; } C = (char)buffer[0]; buffer = buffer.Slice(1); index += 1; arraySize = 10; unsafe { fixed(byte *bytePointer = buffer) fixed(char *charPointer = S) { Encoding.ASCII.GetChars(bytePointer, arraySize, charPointer, S.Length); } } buffer = buffer.Slice(arraySize); index += arraySize; U8 = (byte)BinSerialize.ReadByte(ref buffer); index += 1; S8 = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1; arraySize = 3; for (var i = 0; i < arraySize; i++) { U8Array[i] = (byte)BinSerialize.ReadByte(ref buffer); index += 1; } arraySize = 3; for (var i = 0; i < arraySize; i++) { S8Array[i] = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1; } }
protected override float DeserializeValue(ref ReadOnlySpan <byte> buffer) { return(BinSerialize.ReadFloat(ref buffer)); }
public override void Deserialize(ref ReadOnlySpan <byte> buffer) { base.Deserialize(ref buffer); RawValue = BinSerialize.ReadFloat(ref buffer); }