public static byte[] Decompress(Stream inStream, int count) { if (count < 0) throw new FormatException(); if (inStream.Position + count > inStream.Length) return new byte[count]; byte[] buffer = new byte[count]; inStream.Read(buffer, 0, count); return Decompress(buffer, 0, count); } }