Here you can find the source of isZip(byte[] bytes)
public static boolean isZip(byte[] bytes) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; public class Main { public static boolean isZip(byte[] bytes) throws IOException { return Byte.compare(bytes[0], (byte) 0x50) == 0 && Byte.compare(bytes[1], (byte) 0x4B) == 0; }//from w w w.j a v a 2s . c o m }