ProtocolReader class reads bytes according to a certain protocol.
run the following command in NuGet Package Manager Console.
PM> Install-Package Matarillo.IO
public async Task<byte[]> ReadToSeparatorAsync(byte[] separator)
Reads bytes from the current stream into a byte array until the specified separator occurs, and advances the current position to the next of the separator. The byte array that is returned does not contain the separator.
public async Task<byte[]> ReadBytesAsync(int count)
Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.