Example usage for java.awt Image hashCode

List of usage examples for java.awt Image hashCode

Introduction

In this page you can find the example usage for java.awt Image hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:org.wandora.utils.DataURL.java

public DataURL(Image image) throws MalformedURLException {
    File tempFile = null;/*from  w  w  w .j  a va2s . c o  m*/
    try {
        if (image != null) {
            String prefix = "wandora" + image.hashCode();
            String suffix = ".png";
            tempFile = File.createTempFile(prefix, suffix);
            tempFile.deleteOnExit();
            ImageIO.write(UIBox.makeBufferedImage(image), "png", tempFile);
            mimetype = MimeTypes.getMimeType("png");
            setData(Files.readAllBytes(tempFile.toPath()));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}