diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFile.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFile.java index 3744bd315..5245301bc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFile.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFile.java @@ -173,7 +173,7 @@ public class IggyFile implements StructureInterface { } private static boolean updateIndex(long item_offset /*uint32_t*/, boolean is_64, byte index_bytes[], long item_size_change /*int32_t*/) throws IOException { - ByteArrayDataStream stream = new ByteArrayDataStream(index_bytes, is_64); + ByteArrayDataStream stream = new ByteArrayDataStream(index_bytes); /* index_table: @@ -389,7 +389,7 @@ public class IggyFile implements StructureInterface { * @throws IOException */ private static Long itemLength(long item_offset /*uint32_t*/, boolean is_64, byte index_bytes[], Long newValue) throws IOException { - ByteArrayDataStream stream = new ByteArrayDataStream(index_bytes, is_64); + ByteArrayDataStream stream = new ByteArrayDataStream(index_bytes); /* index_table: @@ -604,11 +604,11 @@ public class IggyFile implements StructureInterface { for (int i = 0; i < subFileEntries.size(); i++) { IggySubFileEntry entry = subFileEntries.get(i); - AbstractDataStream dataStream = new ByteArrayDataStream(getEntryData(i), header.is64()); + AbstractDataStream dataStream = new ByteArrayDataStream(getEntryData(i)); if (entry.type == IggySubFileEntry.TYPE_INDEX) { List indexTable = new ArrayList<>(); List offsets = new ArrayList<>(); - IggyIndexParser.parseIndex(dataStream, indexTable, offsets); + IggyIndexParser.parseIndex(header.is64(), dataStream, indexTable, offsets); indexTables.add(indexTable); offsetTables.add(offsets); } else if (entry.type == IggySubFileEntry.TYPE_FLASH) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFont.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFont.java index a5e1f9cb2..86b61b103 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFont.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFont.java @@ -177,7 +177,7 @@ public class IggyFont extends IggyTag { @Override public void readFromDataStream(AbstractDataStream stream) throws IOException { - ByteArrayDataStream s = new ByteArrayDataStream(stream.readBytes((int) (long) stream.available()), stream.is64()); + ByteArrayDataStream s = new ByteArrayDataStream(stream.readBytes((int) (long) stream.available())); type = s.readUI16(); fontId = s.readUI16(); zeroone = s.readBytes(28); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyIndexParser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyIndexParser.java index 6b52e13fc..9e80df53f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyIndexParser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyIndexParser.java @@ -30,7 +30,7 @@ public class IggyIndexParser { * @param offsets Output list of offsets * @throws IOException on error */ - public static void parseIndex(AbstractDataStream indexStream, List indexTableEntry, List offsets) throws IOException { + public static void parseIndex(boolean is64, AbstractDataStream indexStream, List indexTableEntry, List offsets) throws IOException { int indexTableSize = indexStream.readUI8(); int[] indexTable = new int[indexTableSize]; for (int i = 0; i < indexTableSize; i++) { @@ -90,7 +90,7 @@ public class IggyIndexParser { n = n8 + 1; - if (indexStream.is64()) { + if (is64) { if (i <= 2) { offset += 8 * n; // Ptr type } else if (i <= 4) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/AbstractDataStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/AbstractDataStream.java index dd4b750f2..bd075cfb5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/AbstractDataStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/AbstractDataStream.java @@ -20,9 +20,6 @@ public abstract class AbstractDataStream implements DataStreamInterface { @Override public abstract long position(); - @Override - public abstract boolean is64(); - @Override public long readUI64() throws IOException { try { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ByteArrayDataStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ByteArrayDataStream.java index 9f75d647e..af7dcc0c5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ByteArrayDataStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ByteArrayDataStream.java @@ -12,10 +12,9 @@ public class ByteArrayDataStream extends AbstractDataStream { private byte[] data; private long pos; - private boolean use64bit; - public ByteArrayDataStream(int initialSize, boolean use64bit) { - this(new byte[initialSize], use64bit); + public ByteArrayDataStream(int initialSize) { + this(new byte[initialSize]); } @Override @@ -23,15 +22,9 @@ public class ByteArrayDataStream extends AbstractDataStream { return pos; } - public ByteArrayDataStream(byte data[], boolean use64bit) { + public ByteArrayDataStream(byte data[]) { this.data = data; pos = 0; - this.use64bit = use64bit; - } - - @Override - public boolean is64() { - return use64bit; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/RandomAccessFileDataStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/RandomAccessFileDataStream.java index 88f5d1355..d46efbe6f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/RandomAccessFileDataStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/RandomAccessFileDataStream.java @@ -41,15 +41,6 @@ public class RandomAccessFileDataStream extends AbstractDataStream { } } - public void set64(boolean is64) { - this.is64 = is64; - } - - @Override - public boolean is64() { - return is64; - } - @Override public int read() throws IOException { int val = raf.read(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ReadDataStreamInterface.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ReadDataStreamInterface.java index b6bdf7bd8..0682218d8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ReadDataStreamInterface.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/ReadDataStreamInterface.java @@ -17,8 +17,6 @@ public interface ReadDataStreamInterface extends AutoCloseable { public long position(); - public boolean is64(); - public long readUI64() throws IOException; public long readUI32() throws IOException; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/WriteDataStreamInterface.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/WriteDataStreamInterface.java index cd157ca98..2bcbd6872 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/WriteDataStreamInterface.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/streams/WriteDataStreamInterface.java @@ -17,8 +17,6 @@ public interface WriteDataStreamInterface extends AutoCloseable { public long position(); - public boolean is64(); - public boolean writeUI64(long val) throws IOException; public boolean writeUI32(long val) throws IOException;