Created
July 17, 2018 20:38
-
-
Save aensidhe/c86f679c4aa313ab748de965f0c19575 to your computer and use it in GitHub Desktop.
Nice code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool TryReadExtension(ReadOnlySpan<byte> buffer, out byte type, out IMemoryOwner<byte> extension, out int readSize) | |
{ | |
extension = null; | |
return TryReadExtensionHeader(buffer, out type, out var length, out readSize) | |
&& length <= int.MaxValue | |
&& TryReadExtension(buffer, (int) length, ref extension, ref readSize); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment