You can use InflaterInputStream
from SharpZipLib. .mat
file has header with 0x88 length, so you have to skip it. I took sample file from here SampleMatlabMatDataFiles.zip.
byte[] data = File.ReadAllBytes("c.mat").Skip(0x88).ToArray();
byte[] decompressedData = new byte[10000];
int decompressedLength = 0;
using (MemoryStream memory = new MemoryStream(data))
using (InflaterInputStream inflater = new InflaterInputStream(memory))
decompressedLength = inflater.Read(decompressedData, 0, decompressedData.Length);