class ZipUtils {

  public static boolean isZipFile(File file) throws IOException {
    if (file.isDirectory()) {
      return false;
    }
    // NOTE: little-indian bytes order!
    final byte[] bytes = new byte[4];
    try (FileInputStream fIn = new FileInputStream(file)) {
      if (fIn.read(bytes) != bytes.length) {
        return false;
      }
    }

    ByteBuffer zipFileHeaderSignature = ByteBuffer.wrap(bytes);
    zipFileHeaderSignature.order(ByteOrder.LITTLE_ENDIAN);
    return 0x04034b50 == zipFileHeaderSignature.getInt();
  }

  private  ZipUtils();

}