private static byte[] Decompress(ICompressionProvider compressionProvider, byte[] messageData) { var output = new MemoryStream(); var content = new MemoryStream(messageData.AsMemory(5).ToArray()); var decompressionStream = compressionProvider.CreateDecompressionStream(content); decompressionStream.CopyTo(output); var result = output.ToArray(); return(result); }