Package tv.porst.swfretools.parser.structures

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


    final UINT16 streamId = parseUINT16(parser, 0x00006, "VideoFrame::StreamId");
    final UINT16 frameNum = parseUINT16(parser, 0x00006, "VideoFrame::FrameNum");

    final int dataBytes = header.getNormalizedLength() - UINT16.BYTE_LENGTH - UINT16.BYTE_LENGTH;

    final ByteArray videoData = parseByteArray(parser, dataBytes < 0 ? 0 : dataBytes, 0x00006, "VideoFrame::VideoData");

    return new VideoFrameTag(header, streamId, frameNum, videoData);
  }
View Full Code Here


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

    final ByteArray data = SWFParserHelpers.parseByteArrayIf(parser, header.getNormalizedLength(), 0x00005, header.getNormalizedLength() != 0, "Data");

    return new ProtectTag(header, data);
  }
View Full Code Here

    final int bitmapFormatValue = bitmapFormat.value();

    final UINT8 bitmapColorTableSize = parseUINT8If(parser, 0x00006, bitmapFormatValue == 3, "DefineBitsLossless::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 DefineBitsLosslessTag(header, characterId, bitmapFormat, bitmapWidth, bitmapHeight, bitmapColorTableSize, zlibBitmapData);
  }
View Full Code Here

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

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineBits::CharacterId");
    final ByteArray jpegData = parseByteArray(parser, header.getNormalizedLength() - 2, 0x00006, "DefineBits::JPEGData");

    return new DefineBitsTag(header, characterId, jpegData);
  }
View Full Code Here

    final UBits soundType = parseUBits(parser, 1, 0x00006, "DefineSound::SoundType");
    final UINT32 soundSampleCount = parseUINT32(parser, 0x00006, "DefineSound::SoundSampleCount");

    final int remainingBytes = header.getNormalizedLength() - 2 - 1 - 4;

    final ByteArray soundData = parseByteArray(parser, remainingBytes, 0x00006, "DefineSound::SoundData");

    return new DefineSoundTag(header, soundId, soundFormat, soundRate, soundSize, soundType, soundSampleCount, soundData);
  }
View Full Code Here

   * @return Returns the parsed tag.
   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static JPEGTablesTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {
    final ByteArray jpegData = parseByteArray(parser, header.getNormalizedLength(), 0x00006, "JPEGTables::JPEGData");

    return new JPEGTablesTag(header, jpegData);
  }
View Full Code Here

   */
  public static DefineBitsJPEG3Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineBitsJPEG3::CharacterId");
    final UINT32 alphaDataOffset = parseUINT32(parser, 0x00006, "DefineBitsJPEG3::AlphaDataOffset");
    final ByteArray imageData = parseByteArray(parser, alphaDataOffset.value(), 0x00006, "DefineBitsJPEG3::ImageData");
    final ByteArray bitmapAlphaData = parseByteArray(parser, header.getNormalizedLength() - alphaDataOffset.value() - 4 - 2, 0x00006, "DefineBitsJPEG3::BitmapAlphaData");

    return new DefineBitsJPEG3Tag(header, characterId, alphaDataOffset, imageData, bitmapAlphaData);
  }
View Full Code Here

  public static DefineBitsJPEG4Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineBitsJPEG4::CharacterId");
    final UINT32 alphaDataOffset = parseUINT32(parser, 0x00006, "DefineBitsJPEG4::AlphaDataOffset");
    final UINT16 deblockParam = parseUINT16(parser, 0x00006, "DefineBitsLossless::DeblockParam");
    final ByteArray imageData = parseByteArray(parser, alphaDataOffset.value(), 0x00006, "DefineBitsJPEG4::ImageData");
    final ByteArray bitmapAlphaData = parseByteArray(parser, header.getNormalizedLength() - alphaDataOffset.value(), 0x00006, "DefineBitsJPEG4::BitmapAlphaData");

    return new DefineBitsJPEG4Tag(header, characterId, alphaDataOffset, deblockParam, imageData, bitmapAlphaData);
  }
View Full Code Here

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

    final ByteArray streamSoundData = parseByteArray(parser, header.getNormalizedLength(), 0x00006, "SoundStreamBlock::StreamSoundData");

    return new SoundStreamBlockTag(header, streamSoundData);
  }
View Full Code Here

   */
  public static DefineBinaryDataTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 tag = parseUINT16(parser, 0x00006, "DefineBinaryData::Tag");
    final UINT32 reserved = parseUINT32(parser, 0x00006, "DefineBinaryData::Reserved");
    final ByteArray data = parseByteArray(parser, header.getNormalizedLength() - 2 - 4, 0x00006, "DefineBinaryData::Data");

    return new DefineBinaryDataTag(header, tag, reserved, data);
  }
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.