Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.util.Arrays;
import java.util.zip.CRC32;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedInputStream is = new BufferedInputStream(new FileInputStream("a.exe"));
        byte[] bytes = new byte[1024];
        int len = 0;

        while ((len = is.read(bytes)) >= 0) {
            new CRC32().update(bytes, 0, len);
        }
        is.close();
        System.out.println(Arrays.toString(bytes));

    }
}