There is a magic number at the beginning of the file. Just read the first two bytes and check if they are equal to 0x1f8b
.
More Related Contents:
- How to shift characters to ASCII values in a file based on user input c++ [closed]
- How do I take values from text file and input into a 2D array? c++
- Read file line by line using ifstream in C++
- Read whole ASCII file into C++ std::string [duplicate]
- How do I read an entire file into a std::string in C++?
- Copy a file in a sane, safe and efficient way
- Difference between files written in binary and text mode
- mmap() vs. reading blocks
- How to write a large buffer into a binary file in C++, fast?
- How do I make my program watch for file modification in C++?
- Read file-contents into a string in C++ [duplicate]
- Elegant ways to count the frequency of words in a file
- What is the most elegant way to read a text file with c++?
- Why don’t the std::fstream classes take a std::string?
- How to signify no more input for string ss in the loop while (cin >> ss)
- What is the Fastest Method for High Performance Sequential File I/O in C++?
- checking for eof in string::getline
- C++ ifstream failbit and badbit
- How to read a file into vector in C++?
- Reading and writing a std::vector into a file correctly
- Intercept windows open file
- Simple way to unzip a .zip file using zlib [duplicate]
- fstream won’t create a file [duplicate]
- How to write a Float Mat to a file in OpenCV
- What’s preferred pattern for reading lines from a file in C++?
- how to add zlib to an existing qt installation
- How to check if a file has been opened by another application in C++?
- How to count lines of a file in C++?
- Reading files larger than 4GB using c++ stl
- Performance Difference Between C and C++ Style File IO