Java Zip File Check isZip(byte[] bytes)

Here you can find the source of isZip(byte[] bytes)

Description

is Zip

License

Open Source License

Declaration

public static boolean isZip(byte[] bytes) throws IOException 

Method Source Code

//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
}

Related

  1. isZip(BufferedInputStream in)
  2. isZip(File candidate)
  3. isZip(File f)
  4. isZip(File file)
  5. isZip(File file)