Bugfix: issue #637 (load ICO asset from JAR) in trunk
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11107 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
cc1ebe7b96
commit
85a4ef5e3e
@ -41,6 +41,7 @@ import java.awt.image.AffineTransformOp;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.awt.image.DataBufferInt;
|
import java.awt.image.DataBufferInt;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -210,13 +211,13 @@ public class CursorLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
} else if (isIco) {
|
} else if (isIco) {
|
||||||
DataInputStream in = new DataInputStream(inStream);
|
DataInputStream in = new DataInputStream(inStream);
|
||||||
int bytesToRead;
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
while ((bytesToRead = in.available()) != 0) {
|
byte[] buffer = new byte[16384];
|
||||||
byte[] icoimage2 = new byte[icoimages.length + bytesToRead];
|
int bytesRead;
|
||||||
System.arraycopy(icoimages, 0, icoimage2, 0, icoimages.length);
|
while ((bytesRead = in.read(buffer)) >= 0) {
|
||||||
in.read(icoimage2, icoimages.length, bytesToRead);
|
out.write(buffer, 0, bytesRead);
|
||||||
icoimages = icoimage2;
|
|
||||||
}
|
}
|
||||||
|
icoimages = out.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferedImage bi[] = parseICOImage(icoimages);
|
BufferedImage bi[] = parseICOImage(icoimages);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user