Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool IsGZip(string filename)
- {
- int signlen = 4;
- int count = 0;
- byte[] buf = new byte[signlen];
- FileStream readStream = null;
- try
- {
- readStream = new FileStream(filename, FileMode.Open);
- count = readStream.Read(buf, 0, signlen);
- }
- catch
- {
- return false;
- }
- readStream.Close();
- if (count < 4) return false;
- if ((buf[0] == 0x1F) && (buf[1] == 0x8B) &&
- (buf[2] == 0x08) && (buf[3] == 0x00))
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement