Package tv.porst.swfretools.parser.structures

Examples of tv.porst.swfretools.parser.structures.ByteArray


   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static DefineBitsJPEG2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineBitsJPEG2::CharacterId");
    final ByteArray imageData = parseByteArray(parser, header.getNormalizedLength() - 2, 0x00006, "DefineBitsJPEG2::ImageData");

    return new DefineBitsJPEG2Tag(header, characterId, imageData);
  }
View Full Code Here


    final int bitmapFormatValue = bitmapFormat.value();

    final UINT8 bitmapColorTableSize = parseUINT8If(parser, 0x00006, bitmapFormatValue == 3, "DefineBitsLossless2::BitmapColorTableSize");

    final int numberOfBytes = header.getNormalizedLength() - 2 - 1 - 2 - 2 - (bitmapColorTableSize == null ? 0 : 1);
    final ByteArray zlibBitmapData = parseByteArray(parser, numberOfBytes, 0x00006, "DefineBitsLossless::ZlibBitmapData");

    return new DefineBitsLossless2Tag(header, characterId, bitmapFormat, bitmapWidth, bitmapHeight, bitmapColorTableSize, zlibBitmapData);
  }
View Full Code Here

    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont4::FontFlagsBold");
    final AsciiString fontName = parseString(parser, 0x00006, "DefineFont4::FontName");

    final int remainingLength = header.getNormalizedLength() - 1 - 1 - fontName.value().length() - 1;

    final ByteArray fontData = parseByteArrayIf(parser, remainingLength, 0x00006, fontFlagsHasFontData, "DefineFont4::FontData");

    return new DefineFont4Tag(header, fontId, fontFlagsReserved, fontFlagsHasFontData, fontFlagsItalic, fontFlagsBold, fontName, fontData);
  }
View Full Code Here

   * @throws SWFParserException Thrown if parsing failed.
   */
  public static ByteArray parseByteArray(final SWFBinaryParser parser, final long numberOfBytes, final int errorCode, final String fieldName) throws SWFParserException {
    throwIf(parser, numberOfBytes, errorCode, fieldName);

    return new ByteArray(parser.getBytePosition() * 8 + parser.getBitPosition(), BinaryParserHelpers.readByteArray(parser, (int) numberOfBytes));
  }
View Full Code Here

TOP

Related Classes of tv.porst.swfretools.parser.structures.ByteArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.