do not copy big byte arrays, store only references (ByteArrayRange) e.g in image tags

This commit is contained in:
honfika@gmail.com
2014-11-09 22:40:36 +01:00
parent 270cc40856
commit 3456d04d38
151 changed files with 2787 additions and 2512 deletions

View File

@@ -75,6 +75,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.utf8.Utf8Helper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -131,6 +132,12 @@ public class SWFOutputStream extends OutputStream {
pos += b.length;
}
public void write(ByteArrayRange b) throws IOException {
alignByte();
os.write(b.getArray(), b.getPos(), b.getLength());
pos += b.getLength();
}
private void alignByte() throws IOException {
if (bitPos > 0) {
bitPos = 0;