code: public static void checkIfORC(FileSystem fs, Path path) throws IOException {
      // hardcoded to 40 because "SEQ-org.apache.hadoop.hive.ql.io.RCFile", the header, is of 40 chars
      final int buffLen = 40;
      final byte header[] = new byte[buffLen];
      final FSDataInputStream file = fs.open(path);
      final long fileLength = fs.getFileStatus(path).getLen();
      int sizeToBeRead = buffLen;
      if (buffLen > fileLength) {
        sizeToBeRead = (int)fileLength;
      }
  
      IOUtils.readFully(file, header, 0, sizeToBeRead);
      file.close();
  
      final String headerString = new String(header);
      if (headerString.startsWith("ORC")) {
        LOG.error("Error while parsing the footer of the file : " + path);
      } else {
        throw new NotAnORCFileException("Input file = " + path + " , header = " + headerString);
      }
    }
docs: Reads the file header (first 40 bytes) and checks if the first three characters are 'ORC'.