Ejemplo n.º 1
0
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   fontId = sis.readUI16("fontId");
   if (swf.version >= 6) {
     fontName = sis.readNetString("fontName", Utf8Helper.charset);
   } else {
     fontName = sis.readNetString("fontName");
   }
   reserved = (int) sis.readUB(2, "reserved");
   fontFlagsSmallText = sis.readUB(1, "fontFlagsSmallText") == 1;
   fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
   fontFlagsANSI = sis.readUB(1, "fontFlagsANSI") == 1;
   fontFlagsItalic = sis.readUB(1, "fontFlagsItalic") == 1;
   fontFlagsBold = sis.readUB(1, "fontFlagsBold") == 1;
   fontFlagsWideCodes = sis.readUB(1, "fontFlagsWideCodes") == 1;
   codeTable = new ArrayList<>();
   while (sis.available() > 0) {
     if (fontFlagsWideCodes) {
       codeTable.add(sis.readUI16("code"));
     } else {
       codeTable.add(sis.readUI8("code"));
     }
   }
 }
  @Override
  public final void readData(
      SWFInputStream sis,
      ByteArrayRange data,
      int level,
      boolean parallel,
      boolean skipUnusualTags,
      boolean lazy)
      throws IOException {
    fontId = sis.readUI16("fontId");
    glyphShapeTable = new ArrayList<>();

    if (sis.available() > 0) {
      long pos = sis.getPos();
      int firstOffset = sis.readUI16("firstOffset");
      int nGlyphs = firstOffset / 2;

      long[] offsetTable = new long[nGlyphs];
      offsetTable[0] = firstOffset;
      for (int i = 1; i < nGlyphs; i++) {
        offsetTable[i] = sis.readUI16("offset");
      }
      for (int i = 0; i < nGlyphs; i++) {
        sis.seek(pos + offsetTable[i]);
        glyphShapeTable.add(sis.readSHAPE(1, false, "shape"));
      }
    }
  }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   characterId = sis.readUI32("characterId");
   bitmapFormat = sis.readUI16("bitmapFormat");
   targetWidth = sis.readUI16("targetWidth");
   targetHeight = sis.readUI16("targetHeight");
   exportName = sis.readNetString("exportName");
   fileName = sis.readNetString("fileName");
   if (sis.available() > 0) { // there is usually one zero byte, bod knows why
     extraData = sis.readBytesEx(sis.available(), "extraData");
   }
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   if (sis.available() > 0) {
     reserved = sis.readUI16("reserved");
   } else {
     reserved = 0;
   }
   if (sis.available() > 0) {
     passwordHash = sis.readString("passwordHash");
   } else {
     passwordHash = null;
   }
 }
Ejemplo n.º 5
0
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   streamID = sis.readUI16("streamID");
   frameNum = sis.readUI16("frameNum");
   videoData = sis.readByteRangeEx(sis.available(), "videoData"); // TODO: Parse video packets
 }
Ejemplo n.º 6
0
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public ExporterInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, "ExporterInfo", data);
   this.version = sis.readUI16("version");
   if (this.version >= 0x10a) {
     flags = sis.readUI32("flags");
   }
   bitmapFormat = sis.readUI16("bitmapFormat");
   int prefixLen = sis.readUI8("prefixLen");
   prefix = sis.readBytesEx(prefixLen, "prefix");
   int swfNameLen = sis.readUI8("swfNameLen");
   swfName = new String(sis.readBytesEx(swfNameLen, "swfName"));
   if (sis.available() > 0) // (version >= 0x401) //?
   {
     codeOffsets = new ArrayList<>();
     int numCodeOffsets = sis.readUI16("numCodeOffsets");
     for (int i = 0; i < numCodeOffsets; i++) {
       codeOffsets.add(sis.readUI32("codeOffset"));
     }
   }
 }