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