Reads and validates the frame header. Source reader. Thrown when the peer xlang bitmap does not match this runtime mode.
(ByteReader reader)
| 252 | /// <param name="reader">Source reader.</param> |
| 253 | /// <exception cref="InvalidDataException">Thrown when the peer xlang bitmap does not match this runtime mode.</exception> |
| 254 | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 255 | internal void ReadHead(ByteReader reader) |
| 256 | { |
| 257 | byte bitmap = reader.ReadUInt8(); |
| 258 | if (bitmap == ForyHeaderFlag.IsXlang) |
| 259 | { |
| 260 | return; |
| 261 | } |
| 262 | ThrowInvalidRootHeader(bitmap); |
| 263 | } |
| 264 | |
| 265 | [MethodImpl(MethodImplOptions.NoInlining)] |
| 266 | private static void ThrowUnexpectedTrailingBytes<T>() => |