diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index b5bddb63c..82eb3e42a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -192,7 +192,7 @@ public class SWFInputStream extends InputStream { bitPos = 0; try { return readNoBitReset(); - } catch (EndOfStreamException ex) { + } catch (EOFException | EndOfStreamException ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, null, ex); } return -1; @@ -356,7 +356,7 @@ public class SWFInputStream extends InputStream { } private long readLong() throws IOException { - byte[] readBuffer = readBytes(8); + byte[] readBuffer = readBytesEx(8); return (((long) readBuffer[3] << 56) + ((long) (readBuffer[2] & 255) << 48) + ((long) (readBuffer[1] & 255) << 40) @@ -419,7 +419,7 @@ public class SWFInputStream extends InputStream { * @return Array of read bytes * @throws IOException */ - public byte[] readBytes(long count) throws IOException { + public byte[] readBytesEx(long count) throws IOException { if (count <= 0) { return new byte[0]; } @@ -430,8 +430,30 @@ public class SWFInputStream extends InputStream { return ret; } + /** + * Reads bytes from the stream + * + * @param count Number of bytes to read + * @return Array of read bytes + * @throws IOException + */ + public byte[] readBytes(long count) throws IOException { + if (count <= 0) { + return new byte[0]; + } + byte[] ret = new byte[(int) count]; + try { + for (int i = 0; i < count; i++) { + ret[i] = (byte) readEx(); + } + } catch (EOFException | EndOfStreamException ex) { + Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, null, ex); + } + return ret; + } + public byte[] readBytesZlib(long count) throws IOException { - byte[] data = readBytes(count); + byte[] data = readBytesEx(count); InflaterInputStream dis = new InflaterInputStream(new ByteArrayInputStream(data)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[4096]; @@ -2560,7 +2582,7 @@ public class SWFInputStream extends InputStream { x++; } } - ret.colorMapPixelData = readBytes(dataLen); + ret.colorMapPixelData = readBytesEx(dataLen); return ret; } @@ -2649,7 +2671,7 @@ public class SWFInputStream extends InputStream { x++; } } - ret.colorMapPixelData = readBytes(dataLen); + ret.colorMapPixelData = readBytesEx(dataLen); return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index 779162112..6d1ef9d17 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -78,7 +78,7 @@ public class ActionPush extends Action { super(0x96, actionLength); int type; values = new ArrayList<>(); - sis = new SWFInputStream(new ByteArrayInputStream(sis.readBytes(actionLength)), version); + sis = new SWFInputStream(new ByteArrayInputStream(sis.readBytesEx(actionLength)), version); try { while (sis.available() > 0) { type = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index 01dc785c5..e9e6a6233 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -63,6 +63,6 @@ public class DebugIDTag extends Tag { public DebugIDTag(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DebugID", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); - debugId = sis.readBytes(16); + debugId = sis.readBytesEx(16); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java index 9bb129d3e..f4ce4e423 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java @@ -57,7 +57,7 @@ public class DefineBinaryDataTag extends CharacterTag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); tag = sis.readUI16(); reserved = sis.readUI32(); - binaryData = sis.readBytes(sis.available()); + binaryData = sis.readBytesEx(sis.available()); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index 7c99c5357..842c9229d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -58,7 +58,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { super(swf, ID, "DefineBitsJPEG2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); - imageData = sis.readBytes(sis.available()); + imageData = sis.readBytesEx(sis.available()); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index 2a1c526bc..1230d4883 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -93,7 +93,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); long alphaDataOffset = sis.readUI32(); - imageData = sis.readBytes(alphaDataOffset); + imageData = sis.readBytesEx(alphaDataOffset); bitmapAlphaData = sis.readBytesZlib(sis.available()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index c18a4ee60..c97ebae4f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -131,7 +131,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { characterID = sis.readUI16(); long alphaDataOffset = sis.readUI32(); deblockParam = sis.readUI16(); - imageData = sis.readBytes(alphaDataOffset); - bitmapAlphaData = sis.readBytes(sis.available()); + imageData = sis.readBytesEx(alphaDataOffset); + bitmapAlphaData = sis.readBytesEx(sis.available()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index a8f135702..6154dd0bb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -100,7 +100,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { if (bitmapFormat == FORMAT_8BIT_COLORMAPPED) { bitmapColorTableSize = sis.readUI8(); } - zlibBitmapData = sis.readBytes(sis.available()); + zlibBitmapData = sis.readBytesEx(sis.available()); } private ALPHACOLORMAPDATA colorMapData; private ALPHABITMAPDATA bitmapData; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index cadabc045..687d1ac5c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -165,7 +165,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { if (bitmapFormat == FORMAT_8BIT_COLORMAPPED) { bitmapColorTableSize = sis.readUI8(); } - zlibBitmapData = sis.readBytes(sis.available()); + zlibBitmapData = sis.readBytesEx(sis.available()); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java index 15b0426e9..e738f3fc0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java @@ -49,7 +49,7 @@ public class DefineBitsTag extends ImageTag { super(swf, ID, "DefineBits", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); - jpegData = sis.readBytes(sis.available()); + jpegData = sis.readBytesEx(sis.available()); } private void getJPEGTables(List tags) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index 9284361a7..22fb8e7c3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -137,7 +137,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded SWFInputStream sis = new SWFInputStream(bais, version); int len = sis.readUI16(); if (len != 0) { - origbrdata = sis.readBytes(len - 2); + origbrdata = sis.readBytesEx(len - 2); os2 = new CopyOutputStream(os2, new ByteArrayInputStream(origbrdata)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index 9de31d2b8..7c0fdc207 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -101,7 +101,7 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT characters = sis.readBUTTONRECORDList(false); //actions = sis.readActionList(); hdrSize = sis.getPos(); - actionBytes = sis.readBytes(sis.available()); + actionBytes = sis.readBytesEx(sis.available()); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index ec9d60a7e..b4bb6aabb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -190,7 +190,7 @@ public class DefineFont2Tag extends FontTag { fontFlagsBold = sis.readUB(1) == 1; languageCode = sis.readLANGCODE(); int fontNameLen = sis.readUI8(); - fontName = new String(sis.readBytes(fontNameLen)); + fontName = new String(sis.readBytesEx(fontNameLen)); numGlyphs = sis.readUI16(); //offsetTable = new long[numGlyphs]; for (int i = 0; i < numGlyphs; i++) { //offsetTable diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index 35ba3cdca..23ececee1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -105,7 +105,7 @@ public class DefineFont3Tag extends FontTag { fontFlagsBold = sis.readUB(1) == 1; languageCode = sis.readLANGCODE(); int fontNameLen = sis.readUI8(); - fontName = new String(sis.readBytes(fontNameLen)); + fontName = new String(sis.readBytesEx(fontNameLen)); numGlyphs = sis.readUI16(); for (int i = 0; i < numGlyphs; i++) { //offsetTable if (fontFlagsWideOffsets) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index 207dc1200..0b472988d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -49,7 +49,7 @@ public class DefineFont4Tag extends CharacterTag { fontFlagsItalic = sis.readUB(1) == 1; fontFlagsBold = sis.readUB(1) == 1; fontName = sis.readString(); - fontData = sis.readBytes(sis.available()); + fontData = sis.readBytesEx(sis.available()); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index df2c76a1b..e2a74c60f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -91,7 +91,7 @@ public class DefineFontInfo2Tag extends Tag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontID = sis.readUI16(); int fontNameLen = sis.readUI8(); - fontName = new String(sis.readBytes(fontNameLen)); + fontName = new String(sis.readBytesEx(fontNameLen)); sis.readUB(2);//reserved fontFlagsSmallText = sis.readUB(1) == 1; fontFlagsShiftJIS = sis.readUB(1) == 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index d127b31ba..44a9ab9d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -93,7 +93,7 @@ public class DefineFontInfoTag extends Tag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); int fontNameLen = sis.readUI8(); - fontName = new String(sis.readBytes(fontNameLen)); + fontName = new String(sis.readBytesEx(fontNameLen)); sis.readUB(2); //reserved fontFlagsSmallText = sis.readUB(1) == 1; fontFlagsShiftJIS = sis.readUB(1) == 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index 6c5bbe4ec..2a2744da0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -94,7 +94,7 @@ public class DefineSoundTag extends CharacterTag { soundSize = (int) sis.readUB(1); soundType = (int) sis.readUB(1); soundSampleCount = sis.readUI32(); - soundData = sis.readBytes(sis.available()); + soundData = sis.readBytesEx(sis.available()); } public String getExportFormat() { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 9fef17bbf..316df3fd4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -63,7 +63,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); spriteId = sis.readUI16(); //actions = sis.readActionList(); - actionBytes = sis.readBytes(sis.available()); + actionBytes = sis.readBytesEx(sis.available()); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java index 107234638..39837006c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java @@ -70,7 +70,7 @@ public class EnableTelemetryTag extends Tag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); reserved = (int) sis.readUB(16); if (sis.available() > 0) { - passwordHash = sis.readBytes(32); + passwordHash = sis.readBytesEx(32); } } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index b12c0f650..4d4efe23f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -350,7 +350,7 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO if (placeFlagHasClipActions) { clipActions = sis.readCLIPACTIONS(swf); } - amfData = sis.readBytes(sis.available()); + amfData = sis.readBytesEx(sis.available()); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java index fbe986365..685175b63 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java @@ -68,6 +68,6 @@ public class VideoFrameTag extends Tag { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); streamID = sis.readUI16(); frameNum = sis.readUI16(); - videoData = sis.readBytes(sis.available()); //TODO: Parse video packets + videoData = sis.readBytesEx(sis.available()); //TODO: Parse video packets } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index 06cf02094..cc79c99a2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -80,6 +80,6 @@ public class DefineExternalGradient extends Tag { bitmapsFormat = sis.readUI16(); gradientSize = sis.readUI16(); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index 83ff0bcec..d6e4e5163 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -83,7 +83,7 @@ public class DefineExternalImage extends Tag { targetWidth = sis.readUI16(); targetHeight = sis.readUI16(); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index 6a812df3a..f653ec129 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -91,11 +91,11 @@ public class DefineExternalImage2 extends Tag { targetWidth = sis.readUI16(); targetHeight = sis.readUI16(); int exportNameLen = sis.readUI8(); - exportName = new String(sis.readBytes(exportNameLen)); + exportName = new String(sis.readBytesEx(exportNameLen)); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); if (sis.available() > 0) { //there is usually one zero byte, bod knows why - extraData = sis.readBytes(sis.available()); + extraData = sis.readBytesEx(sis.available()); } } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index 42f305039..c334c7381 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -94,9 +94,9 @@ public class DefineExternalSound extends Tag { sampleCount = sis.readUI32(); seekSample = sis.readUI32(); int exportNameLen = sis.readUI8(); - exportName = new String(sis.readBytes(exportNameLen)); + exportName = new String(sis.readBytesEx(exportNameLen)); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index 7f1f067e4..36f1a7ffc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -93,7 +93,7 @@ public class DefineExternalStreamSound extends Tag { startFrame = sis.readUI32(); lastFrame = sis.readUI32(); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java index 455f8d0f0..24d06c12b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java @@ -100,9 +100,9 @@ public class ExporterInfoTag extends Tag { } bitmapFormat = sis.readUI16(); int prefixLen = sis.readUI8(); - prefix = sis.readBytes(prefixLen); + prefix = sis.readBytesEx(prefixLen); int swfNameLen = sis.readUI8(); - swfName = new String(sis.readBytes(swfNameLen)); + swfName = new String(sis.readBytesEx(swfNameLen)); if (sis.available() > 0) // (version >= 0x401) //? { codeOffsets = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index 84bd4c144..5d4c9d8ec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -99,7 +99,7 @@ public class FontTextureInfo extends Tag { textureID = sis.readUI32(); textureFormat = sis.readUI16(); int fileNameLen = sis.readUI8(); - fileName = new String(sis.readBytes(fileNameLen)); + fileName = new String(sis.readBytesEx(fileNameLen)); textureWidth = sis.readUI16(); textureHeight = sis.readUI16(); padPixels = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index bbab495ed..a2f0f7ff2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -73,9 +73,9 @@ public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem { condKeyPress = (int) sis.readUB(7); condOverDownToIddle = sis.readUB(1) == 1; if (condActionSize <= 0) { - actionBytes = sis.readBytes(sis.available()); + actionBytes = sis.readBytesEx(sis.available()); } else { - actionBytes = sis.readBytes(condActionSize - 4); + actionBytes = sis.readBytesEx(condActionSize - 4); } } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 9ff9ceec9..e6435e8f9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -103,7 +103,7 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem { actionRecordSize--; } hdrPos = sis.getPos(); - actionBytes = sis.readBytes(actionRecordSize); + actionBytes = sis.readBytesEx(actionRecordSize); this.pos = pos; }