public bool IsGZipped(BlobKey key)
{
var magic = 0;
var path = PathForKey(key);
var file = new FilePath(path);
if (file.CanRead())
{
try
{
var raf = new RandomAccessFile(file, "r");
magic = raf.Read() & unchecked((0xff)) | ((raf.Read() << 8) & unchecked((0xff00)));
raf.Close();
}
catch (Exception e)
{
Runtime.PrintStackTrace(e, Console.Error);
}
}
return magic == GZIPInputStream.GzipMagic;
}