Package flash.swf

Examples of flash.swf.TagEncoder


        // which extends ByteArrayOutputStream -- this writer would need to be replaced with
        // some other object that can accept an OutputStream in its constructor. The point is
        // to eliminate the extra buffers, and just always write directly to the intended target.
        // - mikemo
        final boolean useCompression = configuration.getCompilerConfiguration().useCompression();
        TagEncoder encoder = configuration.generateSizeReport() ? new TagEncoderReporter() : new TagEncoder();
        new MovieEncoder(encoder).export(movie, useCompression);
        encoder.writeTo(out);
        generateSizeReport(configuration, movie, encoder);

        if (ThreadLocalToolkit.getBenchmark() != null)
        {
            LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
View Full Code Here


        // which extends ByteArrayOutputStream -- this writer would need to be replaced with
        // some other object that can accept an OutputStream in its constructor. The point is
        // to eliminate the extra buffers, and just always write directly to the intended target.
        // - mikemo
        final boolean useCompression = configuration.getCompilerConfiguration().useCompression();
        TagEncoder encoder = configuration.generateSizeReport() ? new TagEncoderReporter() : new TagEncoder();       
        new MovieEncoder(encoder).export(movie, useCompression);
        encoder.writeTo(out);
        generateSizeReport(configuration, movie, encoder);

        if (ThreadLocalToolkit.getBenchmark() != null)
        {
            LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
View Full Code Here

  {
    if (lib == null || lib.data == null || lib.data.movie == null) return 0;
   
    try
    {
      TagEncoder handler = new TagEncoder();
      MovieEncoder encoder = new MovieEncoder(handler);
      encoder.export(lib.data.movie);
           
            //TODO PERFORMANCE: A lot of unnecessary recopying here
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      handler.writeTo(baos);

      return flex2.tools.WebTierAPI.optimize(new ByteArrayInputStream(baos.toByteArray()),
                      out,
                      lib.data.configuration);
    }
View Full Code Here

      debugPrinter.tabbedGlyphs = tabbedGlyphsOption;
     
      if (encodeOption)
      {
        // decode -> encode -> decode -> print
        TagEncoder encoder = new TagEncoder();
        in = url.openStream();
        new TagDecoder(in, url).parse(encoder);
        encoder.finish();
        in = new ByteArrayInputStream(encoder.toByteArray());
      }
      else
      {
        // decode -> print
        in = url.openStream();
View Full Code Here

            if (args[i].equals("-aspath"))
            {
                aspath = args[++i];
                continue;
            }
            TagEncoder encoder = new TagEncoder();
            //ConsoleOutputHandler tagHandler = new ConsoleOutputHandler(null, null);
            SwfxParser swfxParser = new SwfxParser(encoder, StringUtils.splitPath(aspath));
            boolean success = swfxParser.parse(args[i]);//, tagHandler);
            if (success)
            {
                String swfFileName = args[i].substring(0, args[i].lastIndexOf('.')) + ".swf";
                OutputStream out = new BufferedOutputStream(new FileOutputStream(swfFileName));
                try
                {
                    encoder.writeTo(out);
                }
                finally
                {
                    out.close();
                }
View Full Code Here

        forceLibraryVersion1 = version < MxmlConfiguration.VERSION_3_0;
        versions.setMinimumVersion(linkerConfiguration.getMinimumSupportedVersionString());
       
        // get SWF bytes
        ByteArrayOutputStream swfOut = new ByteArrayOutputStream();
        TagEncoder encoder = linkerConfiguration.generateSizeReport() ? new TagEncoderReporter() : new TagEncoder();
        new MovieEncoder(encoder).export(movie, true); // always compress library.swf
        encoder.writeTo(swfOut);
        generateSizeReport(linkerConfiguration, movie, encoder);

        swfOut.flush();
        byte[] swf = swfOut.toByteArray();
        swfOut.close();
View Full Code Here

        {
          frame.addExport(asset);
        }
      }

      TagEncoder handler = new TagEncoder();
      MovieEncoder encoder = new MovieEncoder(handler);
      encoder.export(movie, true); // use compression

      // Hack: Nasty hard-coded knowledge that 'out' refers to the same file as 'file'
      writeU32(out, 0);
      out.flush();
      long before = file.getFilePointer();
      handler.writeTo(out);
      out.flush();
      long after = file.getFilePointer();
      file.seek(before - 4);
      file.writeInt((int)(after - before));
      file.seek(after);
View Full Code Here

      debugPrinter.tabbedGlyphs = tabbedGlyphsOption;
     
      if (encodeOption)
      {
        // decode -> encode -> decode -> print
        TagEncoder encoder = new TagEncoder();
        in = url.openStream();
        new TagDecoder(in, url).parse(encoder);
        encoder.finish();
        in = new ByteArrayInputStream(encoder.toByteArray());
      }
      else
      {
        // decode -> print
        in = url.openStream();
View Full Code Here

                // optimize
                flex2.tools.WebTierAPI.optimize(movie, configuration);

                    //TODO PERFORMANCE: A lot of unnecessary recopying and buffering here
                // encode
                TagEncoder handler = new TagEncoder();
                MovieEncoder encoder = new MovieEncoder(handler);
                encoder.export(movie, true);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                handler.writeTo(out);
               
                FileUtil.writeBinaryFile(output, out.toByteArray());
                System.out.println(output + " (" + outputFile.length() + " bytes)");             
            }
            else
View Full Code Here

        po3.matrix = new Matrix();
        po3.setRef(sprite);
        po3.depth = depth;
        frame.controlTags.add(po3);

        TagEncoder tagEncoder = new TagEncoder();
        MovieEncoder movieEncoder = new MovieEncoder(tagEncoder);
        movieEncoder.export(movie);
        tagEncoder.writeTo(fout);

    }
View Full Code Here

TOP

Related Classes of flash.swf.TagEncoder

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.