Example usage for java.io FileInputStream hashCode

List of usage examples for java.io FileInputStream hashCode

Introduction

In this page you can find the example usage for java.io FileInputStream hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:AIR.ResourceBundler.Console.ResourcesBuilder.java

private static void writeFileHeader(FileWriter sw, String filePath) throws IOException {
    File scriptInfo = new File(filePath);

    // get file crc
    String crcResult = "";

    FileInputStream fs = new FileInputStream(filePath);
    byte[] bb = new byte[4];
    int i = fs.hashCode();
    for (int k = 3, j = 0; k >= 0; k--, j += 8) {
        bb[k] = (byte) (i >> j);
    }//from   w  ww .  j a v  a  2 s . c om

    for (byte b : bb)
        crcResult += String.format("%2X", b).toLowerCase();

    // write out script info
    String resourceFile = Path.getFileName(filePath);
    sw.write(String.format("/* SOURCE FILE: %s (%s) %s */\n", resourceFile, crcResult,
            scriptInfo.lastModified()));
    sw.write("\n");
}