Program: 61449
Project: 61449
Buggy source:
private void convertMedia(SWF swf,Map<Integer,String> characterVariables,Map<Integer,String> characterClasses,List<Integer> nonLibraryShapes,String backgroundColor,ReadOnlyTagList tags,HashMap<Integer,CharacterTag> characters,HashMap<String,byte[]> files,HashMap<String,byte[]> datfiles,FLAVersion flaVersion,XFLXmlWriter writer) throws XMLStreamException {
  boolean hasMedia=false;
  for (  int ch : characters.keySet()) {
    CharacterTag symbol=characters.get(ch);
    if (symbol instanceof ImageTag || symbol instanceof SoundStreamHeadTypeTag || symbol instanceof DefineSoundTag|| symbol instanceof DefineVideoStreamTag) {
      hasMedia=true;
    }
  }
  if (!hasMedia) {
    return;
  }
  int mediaCount=0;
  writer.writeStartElement("String_Node_Str");
  for (  int ch : characters.keySet()) {
    CharacterTag symbol=characters.get(ch);
    if (symbol instanceof ImageTag) {
      ImageTag imageTag=(ImageTag)symbol;
      boolean allowSmoothing=false;
      looptags:       for (      Tag tag : swf.getTags()) {
        if (tag instanceof ShapeTag) {
          Set<Integer> needed=new HashSet<>();
          tag.getNeededCharacters(needed);
          ShapeTag sht=(ShapeTag)tag;
          if (needed.contains(imageTag.getCharacterId())) {
            List<FILLSTYLE> fs=new ArrayList<>();
            SHAPEWITHSTYLE s=sht.getShapes();
            for (            FILLSTYLE f : s.fillStyles.fillStyles) {
              fs.add(f);
            }
            for (            SHAPERECORD r : s.shapeRecords) {
              if (r instanceof StyleChangeRecord) {
                StyleChangeRecord scr=(StyleChangeRecord)r;
                if (scr.stateNewStyles) {
                  for (                  FILLSTYLE f : scr.fillStyles.fillStyles) {
                    fs.add(f);
                  }
                }
              }
            }
            for (            FILLSTYLE f : fs) {
              if (Arrays.asList(FILLSTYLE.REPEATING_BITMAP,FILLSTYLE.CLIPPED_BITMAP,FILLSTYLE.NON_SMOOTHED_REPEATING_BITMAP,FILLSTYLE.NON_SMOOTHED_CLIPPED_BITMAP).contains(f.fillStyleType) && f.bitmapId == imageTag.getCharacterId()) {
                allowSmoothing=f.fillStyleType == FILLSTYLE.CLIPPED_BITMAP || f.fillStyleType == FILLSTYLE.REPEATING_BITMAP;
                break looptags;
              }
            }
          }
        }
      }
      byte[] imageBytes=Helper.readStream(imageTag.getImageData());
      SerializableImage image=imageTag.getImageCached();
      ImageFormat format=imageTag.getImageFormat();
      String symbolFile="String_Node_Str" + symbol.getCharacterId() + imageTag.getImageFormat().getExtension();
      files.put(symbolFile,imageBytes);
      writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(imageBytes.length)});
      if (allowSmoothing) {
        writer.writeAttribute("String_Node_Str",true);
      }
switch (format) {
case PNG:
case GIF:
        if (imageTag.getOriginalImageFormat() != ImageFormat.JPEG) {
          writer.writeAttribute("String_Node_Str",false);
          writer.writeAttribute("String_Node_Str","String_Node_Str");
        }
      writer.writeAttribute("String_Node_Str","String_Node_Str");
    break;
case JPEG:
  writer.writeAttribute("String_Node_Str",true);
break;
}
if (characterClasses.containsKey(symbol.getCharacterId())) {
writer.writeAttribute("String_Node_Str",true);
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
writer.writeAttribute("String_Node_Str",50);
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str","String_Node_Str" + (mediaCount + 1) + "String_Node_Str"+ getTimestamp(swf)+ "String_Node_Str");
writer.writeAttribute("String_Node_Str",image.getWidth());
writer.writeAttribute("String_Node_Str",image.getHeight());
writer.writeEndElement();
mediaCount++;
}
 else if ((symbol instanceof SoundStreamHeadTypeTag) || (symbol instanceof DefineSoundTag)) {
int soundFormat=0;
int soundRate=0;
boolean soundType=false;
boolean soundSize=false;
long soundSampleCount=0;
byte[] soundData=SWFInputStream.BYTE_ARRAY_EMPTY;
int[] rateMap={5,11,22,44};
String exportFormat="String_Node_Str";
if (symbol instanceof SoundStreamHeadTypeTag) {
SoundStreamHeadTypeTag sstream=(SoundStreamHeadTypeTag)symbol;
soundFormat=sstream.getSoundFormatId();
soundRate=sstream.getSoundRate();
soundType=sstream.getSoundType();
soundSize=sstream.getSoundSize();
soundSampleCount=sstream.getSoundSampleCount();
boolean found=false;
for (Tag t : tags) {
if (found && (t instanceof SoundStreamBlockTag)) {
  SoundStreamBlockTag bl=(SoundStreamBlockTag)t;
  soundData=bl.streamSoundData.getRangeData();
  break;
}
if (t == symbol) {
  found=true;
}
}
}
 else if (symbol instanceof DefineSoundTag) {
DefineSoundTag sound=(DefineSoundTag)symbol;
soundFormat=sound.soundFormat;
soundRate=sound.soundRate;
soundType=sound.soundType;
soundData=sound.soundData.getRangeData();
soundSize=sound.soundSize;
soundSampleCount=sound.soundSampleCount;
}
int format=0;
int bits=0;
if ((soundFormat == SoundFormat.FORMAT_ADPCM) || (soundFormat == SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN) || (soundFormat == SoundFormat.FORMAT_UNCOMPRESSED_NATIVE_ENDIAN)) {
exportFormat="String_Node_Str";
if (soundType) {
format+=1;
}
switch (soundRate) {
case 0:
format+=2;
break;
case 1:
format+=6;
break;
case 2:
format+=10;
break;
case 3:
format+=14;
break;
}
}
if (soundFormat == SoundFormat.FORMAT_SPEEX) {
bits=18;
}
if (soundFormat == SoundFormat.FORMAT_ADPCM) {
exportFormat="String_Node_Str";
try {
SWFInputStream sis=new SWFInputStream(swf,soundData);
int adpcmCodeSize=(int)sis.readUB(2,"String_Node_Str");
bits=2 + adpcmCodeSize;
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
}
if (soundFormat == SoundFormat.FORMAT_MP3) {
exportFormat="String_Node_Str";
if (!soundType) {
format+=1;
}
format+=4;
try {
MP3SOUNDDATA s=new MP3SOUNDDATA(new SWFInputStream(swf,soundData),false);
MP3FRAME frame=s.frames.get(0);
int bitRate=frame.getBitRate();
switch (bitRate) {
case 8:
bits=6;
break;
case 16:
bits=7;
break;
case 20:
bits=8;
break;
case 24:
bits=9;
break;
case 32:
bits=10;
break;
case 48:
bits=11;
break;
case 56:
bits=12;
break;
case 64:
bits=13;
break;
case 80:
bits=14;
break;
case 112:
bits=15;
break;
case 128:
bits=16;
break;
case 160:
bits=17;
break;
}
}
 catch (IOException|ArrayIndexOutOfBoundsException ex) {
logger.log(Level.SEVERE,null,ex);
}
}
SoundTag st=(SoundTag)symbol;
SoundFormat fmt=st.getSoundFormat();
byte[] data=SWFInputStream.BYTE_ARRAY_EMPTY;
try {
data=new SoundExporter().exportSound(st,SoundExportMode.MP3_WAV);
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
String symbolFile="String_Node_Str" + symbol.getCharacterId() + "String_Node_Str"+ exportFormat;
files.put(symbolFile,data);
writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(data.length)});
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str",rateMap[soundRate] + "String_Node_Str" + "String_Node_Str"+ (soundSize ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ (soundType ? "String_Node_Str" : "String_Node_Str"));
writer.writeAttribute("String_Node_Str",format);
writer.writeAttribute("String_Node_Str",bits);
writer.writeAttribute("String_Node_Str",soundSampleCount);
boolean linkageExportForAS=false;
if (characterClasses.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
if (characterVariables.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterVariables.get(symbol.getCharacterId()));
}
if (linkageExportForAS) {
writer.writeAttribute("String_Node_Str",true);
}
writer.writeEndElement();
mediaCount++;
}
 else if (symbol instanceof DefineVideoStreamTag) {
DefineVideoStreamTag video=(DefineVideoStreamTag)symbol;
String videoType="String_Node_Str";
switch (video.codecID) {
case 2:
videoType="String_Node_Str";
break;
case 3:
videoType="String_Node_Str";
break;
case 4:
videoType="String_Node_Str";
break;
case 5:
videoType="String_Node_Str";
break;
}
byte[] data=SWFInputStream.BYTE_ARRAY_EMPTY;
try {
data=new MovieExporter().exportMovie(video,MovieExportMode.FLV);
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
String symbolFile="String_Node_Str" + symbol.getCharacterId() + "String_Node_Str"+ "String_Node_Str";
if (data.length == 0) {
long ts=getTimestamp(swf);
String datFileName="String_Node_Str" + (datfiles.size() + 1) + "String_Node_Str"+ ts+ "String_Node_Str";
writer.writeEmptyElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str","String_Node_Str" + symbolFile,"String_Node_Str",Long.toString(ts),"String_Node_Str",datFileName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
datfiles.put(datFileName,new byte[]{(byte)0x03,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x78,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x59,(byte)0x40,(byte)0x18,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0xFF,(byte)0xFE,(byte)0xFF,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00});
}
 else {
files.put(symbolFile,data);
writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(data.length)});
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str",videoType);
writer.writeAttribute("String_Node_Str",(int)swf.frameRate);
writer.writeAttribute("String_Node_Str",video.width);
writer.writeAttribute("String_Node_Str",video.height);
double len=(double)video.numFrames / swf.frameRate;
writer.writeAttribute("String_Node_Str",len);
boolean linkageExportForAS=false;
if (characterClasses.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
if (characterVariables.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterVariables.get(symbol.getCharacterId()));
}
if (linkageExportForAS) {
writer.writeAttribute("String_Node_Str",true);
}
writer.writeEndElement();
}
mediaCount++;
}
}
writer.writeEndElement();
}

Fixed version (ground truth):
private void convertMedia(SWF swf,Map<Integer,String> characterVariables,Map<Integer,String> characterClasses,List<Integer> nonLibraryShapes,String backgroundColor,ReadOnlyTagList tags,HashMap<Integer,CharacterTag> characters,HashMap<String,byte[]> files,HashMap<String,byte[]> datfiles,FLAVersion flaVersion,XFLXmlWriter writer) throws XMLStreamException {
  boolean hasMedia=false;
  for (  int ch : characters.keySet()) {
    CharacterTag symbol=characters.get(ch);
    if (symbol instanceof ImageTag || symbol instanceof SoundStreamHeadTypeTag || symbol instanceof DefineSoundTag|| symbol instanceof DefineVideoStreamTag) {
      hasMedia=true;
    }
  }
  if (!hasMedia) {
    return;
  }
  int mediaCount=0;
  writer.writeStartElement("String_Node_Str");
  for (  int ch : characters.keySet()) {
    CharacterTag symbol=characters.get(ch);
    if (symbol instanceof ImageTag) {
      ImageTag imageTag=(ImageTag)symbol;
      boolean allowSmoothing=false;
      looptags:       for (      Tag tag : swf.getTags()) {
        if (tag instanceof ShapeTag) {
          Set<Integer> needed=new HashSet<>();
          tag.getNeededCharacters(needed);
          ShapeTag sht=(ShapeTag)tag;
          if (needed.contains(imageTag.getCharacterId())) {
            List<FILLSTYLE> fs=new ArrayList<>();
            SHAPEWITHSTYLE s=sht.getShapes();
            for (            FILLSTYLE f : s.fillStyles.fillStyles) {
              fs.add(f);
            }
            for (            SHAPERECORD r : s.shapeRecords) {
              if (r instanceof StyleChangeRecord) {
                StyleChangeRecord scr=(StyleChangeRecord)r;
                if (scr.stateNewStyles) {
                  for (                  FILLSTYLE f : scr.fillStyles.fillStyles) {
                    fs.add(f);
                  }
                }
              }
            }
            for (            FILLSTYLE f : fs) {
              if (Arrays.asList(FILLSTYLE.REPEATING_BITMAP,FILLSTYLE.CLIPPED_BITMAP,FILLSTYLE.NON_SMOOTHED_REPEATING_BITMAP,FILLSTYLE.NON_SMOOTHED_CLIPPED_BITMAP).contains(f.fillStyleType) && f.bitmapId == imageTag.getCharacterId()) {
                allowSmoothing=f.fillStyleType == FILLSTYLE.CLIPPED_BITMAP || f.fillStyleType == FILLSTYLE.REPEATING_BITMAP;
                break looptags;
              }
            }
          }
        }
      }
      byte[] imageBytes=Helper.readStream(imageTag.getImageData());
      SerializableImage image=imageTag.getImageCached();
      ImageFormat format=imageTag.getImageFormat();
      String symbolFile="String_Node_Str" + symbol.getCharacterId() + imageTag.getImageFormat().getExtension();
      files.put(symbolFile,imageBytes);
      writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(imageBytes.length)});
      if (allowSmoothing) {
        writer.writeAttribute("String_Node_Str",true);
      }
switch (format) {
case PNG:
case GIF:
        if (imageTag.getOriginalImageFormat() != ImageFormat.JPEG) {
          writer.writeAttribute("String_Node_Str",false);
          writer.writeAttribute("String_Node_Str","String_Node_Str");
        }
      writer.writeAttribute("String_Node_Str","String_Node_Str");
    break;
case JPEG:
  writer.writeAttribute("String_Node_Str",true);
break;
}
if (characterClasses.containsKey(symbol.getCharacterId())) {
writer.writeAttribute("String_Node_Str",true);
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
writer.writeAttribute("String_Node_Str",50);
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str","String_Node_Str" + (mediaCount + 1) + "String_Node_Str"+ getTimestamp(swf)+ "String_Node_Str");
writer.writeAttribute("String_Node_Str",image.getWidth());
writer.writeAttribute("String_Node_Str",image.getHeight());
writer.writeEndElement();
mediaCount++;
}
 else if ((symbol instanceof SoundStreamHeadTypeTag) || (symbol instanceof DefineSoundTag)) {
int soundFormat=0;
int soundRate=0;
boolean soundType=false;
boolean soundSize=false;
long soundSampleCount=0;
byte[] soundData=SWFInputStream.BYTE_ARRAY_EMPTY;
int[] rateMap={5,11,22,44};
String exportFormat="String_Node_Str";
if (symbol instanceof SoundStreamHeadTypeTag) {
SoundStreamHeadTypeTag sstream=(SoundStreamHeadTypeTag)symbol;
soundFormat=sstream.getSoundFormatId();
soundRate=sstream.getSoundRate();
soundType=sstream.getSoundType();
soundSize=sstream.getSoundSize();
soundSampleCount=sstream.getSoundSampleCount();
boolean found=false;
for (Tag t : tags) {
if (found && (t instanceof SoundStreamBlockTag)) {
  SoundStreamBlockTag bl=(SoundStreamBlockTag)t;
  soundData=bl.streamSoundData.getRangeData();
  break;
}
if (t == symbol) {
  found=true;
}
}
}
 else if (symbol instanceof DefineSoundTag) {
DefineSoundTag sound=(DefineSoundTag)symbol;
soundFormat=sound.soundFormat;
soundRate=sound.soundRate;
soundType=sound.soundType;
soundData=sound.soundData.getRangeData();
soundSize=sound.soundSize;
soundSampleCount=sound.soundSampleCount;
}
int format=0;
int bits=0;
if ((soundFormat == SoundFormat.FORMAT_ADPCM) || (soundFormat == SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN) || (soundFormat == SoundFormat.FORMAT_UNCOMPRESSED_NATIVE_ENDIAN)) {
exportFormat="String_Node_Str";
if (soundType) {
format+=1;
}
switch (soundRate) {
case 0:
format+=2;
break;
case 1:
format+=6;
break;
case 2:
format+=10;
break;
case 3:
format+=14;
break;
}
}
if (soundFormat == SoundFormat.FORMAT_SPEEX) {
bits=18;
}
if (soundFormat == SoundFormat.FORMAT_ADPCM) {
exportFormat="String_Node_Str";
try {
SWFInputStream sis=new SWFInputStream(swf,soundData);
int adpcmCodeSize=(int)sis.readUB(2,"String_Node_Str");
bits=2 + adpcmCodeSize;
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
}
if (soundFormat == SoundFormat.FORMAT_MP3) {
exportFormat="String_Node_Str";
if (!soundType) {
format+=1;
}
format+=4;
try {
MP3SOUNDDATA s=new MP3SOUNDDATA(new SWFInputStream(swf,soundData),false);
MP3FRAME frame=s.frames.get(0);
int bitRate=frame.getBitRate();
switch (bitRate) {
case 8:
bits=6;
break;
case 16:
bits=7;
break;
case 20:
bits=8;
break;
case 24:
bits=9;
break;
case 32:
bits=10;
break;
case 48:
bits=11;
break;
case 56:
bits=12;
break;
case 64:
bits=13;
break;
case 80:
bits=14;
break;
case 112:
bits=15;
break;
case 128:
bits=16;
break;
case 160:
bits=17;
break;
}
}
 catch (IOException|IndexOutOfBoundsException ex) {
logger.log(Level.SEVERE,null,ex);
}
}
SoundTag st=(SoundTag)symbol;
SoundFormat fmt=st.getSoundFormat();
byte[] data=SWFInputStream.BYTE_ARRAY_EMPTY;
try {
data=new SoundExporter().exportSound(st,SoundExportMode.MP3_WAV);
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
String symbolFile="String_Node_Str" + symbol.getCharacterId() + "String_Node_Str"+ exportFormat;
files.put(symbolFile,data);
writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(data.length)});
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str",rateMap[soundRate] + "String_Node_Str" + "String_Node_Str"+ (soundSize ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ (soundType ? "String_Node_Str" : "String_Node_Str"));
writer.writeAttribute("String_Node_Str",format);
writer.writeAttribute("String_Node_Str",bits);
writer.writeAttribute("String_Node_Str",soundSampleCount);
boolean linkageExportForAS=false;
if (characterClasses.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
if (characterVariables.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterVariables.get(symbol.getCharacterId()));
}
if (linkageExportForAS) {
writer.writeAttribute("String_Node_Str",true);
}
writer.writeEndElement();
mediaCount++;
}
 else if (symbol instanceof DefineVideoStreamTag) {
DefineVideoStreamTag video=(DefineVideoStreamTag)symbol;
String videoType="String_Node_Str";
switch (video.codecID) {
case 2:
videoType="String_Node_Str";
break;
case 3:
videoType="String_Node_Str";
break;
case 4:
videoType="String_Node_Str";
break;
case 5:
videoType="String_Node_Str";
break;
}
byte[] data=SWFInputStream.BYTE_ARRAY_EMPTY;
try {
data=new MovieExporter().exportMovie(video,MovieExportMode.FLV);
}
 catch (IOException ex) {
logger.log(Level.SEVERE,null,ex);
}
String symbolFile="String_Node_Str" + symbol.getCharacterId() + "String_Node_Str"+ "String_Node_Str";
if (data.length == 0) {
long ts=getTimestamp(swf);
String datFileName="String_Node_Str" + (datfiles.size() + 1) + "String_Node_Str"+ ts+ "String_Node_Str";
writer.writeEmptyElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str","String_Node_Str" + symbolFile,"String_Node_Str",Long.toString(ts),"String_Node_Str",datFileName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
datfiles.put(datFileName,new byte[]{(byte)0x03,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x78,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x59,(byte)0x40,(byte)0x18,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0xFF,(byte)0xFE,(byte)0xFF,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00});
}
 else {
files.put(symbolFile,data);
writer.writeStartElement("String_Node_Str",new String[]{"String_Node_Str",symbolFile,"String_Node_Str",Long.toString(getTimestamp(swf)),"String_Node_Str",Integer.toString(data.length)});
writer.writeAttribute("String_Node_Str",symbolFile);
writer.writeAttribute("String_Node_Str",videoType);
writer.writeAttribute("String_Node_Str",(int)swf.frameRate);
writer.writeAttribute("String_Node_Str",video.width);
writer.writeAttribute("String_Node_Str",video.height);
double len=(double)video.numFrames / swf.frameRate;
writer.writeAttribute("String_Node_Str",len);
boolean linkageExportForAS=false;
if (characterClasses.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterClasses.get(symbol.getCharacterId()));
}
if (characterVariables.containsKey(symbol.getCharacterId())) {
linkageExportForAS=true;
writer.writeAttribute("String_Node_Str",characterVariables.get(symbol.getCharacterId()));
}
if (linkageExportForAS) {
writer.writeAttribute("String_Node_Str",true);
}
writer.writeEndElement();
}
mediaCount++;
}
}
writer.writeEndElement();
}