boolean pngIcon = false;
if (entries[i].dwBytesInRes > PNG_SIGNATURE.length) {
// Check if this is a PNG icon (introduced in Windows Vista)
in.mark(1024 * 1024);
in.skip(entries[i].dwImageOffset);
byte[] signatureBuffer = new byte[PNG_SIGNATURE.length];
in.read(signatureBuffer, 0, PNG_SIGNATURE.length);
pngIcon = Arrays.equals(PNG_SIGNATURE, signatureBuffer);
in.reset();
}