示例#1
0
 public bool CanSniff(byte[] imageData)
 {
     if (imageData.Length >= StartOfFile.Length &&
         BinaryHelpers.CompareBytes(imageData, 0, StartOfFile, 0, 2))
     {
         return(true);
     }
     return(false);
 }
        private readonly byte[] GIF = { 0x47, 0x49, 0x46 }; // "GIF"

        public bool CanSniff(byte[] imageData)
        {
            if (imageData.Length >= GIF.Length &&
                BinaryHelpers.CompareBytes(imageData, 0, GIF, 0, 3))
            {
                return(true);
            }
            return(false);
        }
        private readonly byte[] WEBP = { 0x57, 0x45, 0x42, 0x50 }; // "WEBP"

        public bool CanSniff(byte[] imageData)
        {
            if (imageData.Length >= 12 &&
                BinaryHelpers.CompareBytes(imageData, 0, RIFF, 0, 4) &&
                BinaryHelpers.CompareBytes(imageData, 8, WEBP, 0, 4))
            {
                return(true);
            }
            return(false);
        }