faster loading of compressed files

This commit is contained in:
Honfika
2014-03-21 23:53:45 +01:00
parent 490378991e
commit db36ddd9a6
3 changed files with 5 additions and 4 deletions

View File

@@ -539,7 +539,8 @@ public final class SWF implements TreeItem, Timelined {
gfx = true;
}
if (hdr[0] == 'C') {
sis = new SWFInputStream(new InflaterInputStream(is), version, 8);
byte[] uncompressedData = Helper.readStream(new InflaterInputStream(is));
sis = new SWFInputStream(new ByteArrayInputStream(uncompressedData), version, 8);
compressed = true;
}

View File

@@ -641,11 +641,11 @@ public class SWFInputStream extends InputStream {
* @return Array of read bytes
* @throws IOException
*/
public byte[] readBytes(long count) throws IOException {
public byte[] readBytes(int count) throws IOException {
if (count <= 0) {
return new byte[0];
}
byte[] ret = new byte[(int) count];
byte[] ret = new byte[count];
try {
for (int i = 0; i < count; i++) {
ret[i] = (byte) readEx();

View File

@@ -97,7 +97,7 @@ public class Configuration {
public static final ConfigurationItem<Boolean> useRibbonInterface = null;
@ConfigurationDefaultBoolean(false)
public static final ConfigurationItem<Boolean> openFolderAfterFlaExport = null;
@ConfigurationDefaultBoolean(true)
@ConfigurationDefaultBoolean(false)
public static final ConfigurationItem<Boolean> useDetailedLogging = null;
@ConfigurationDefaultInt(65536)