Examples of ISWFWriter


Examples of org.apache.flex.swf.io.ISWFWriter

                        {
                            Header.Compression compression = Header.decideCompression(true, swf.getVersion(), false);
   
                            final ISWFWriterFactory writerFactory = SWFWriterAndSizeReporter.getSWFWriterFactory(
                                    targetSettings.getSizeReport());
                            final ISWFWriter writer = writerFactory.createSWFWriter(optimizedSWF, compression, targetSettings.isDebugEnabled());
                            int swfSize = writer.writeTo(outputFile);
           
                            long endTime = System.nanoTime();
                            String seconds = String.format("%5.3f", (endTime - startTime) / 1e9);
                            Map<String, Object> params = new HashMap<String, Object>();
                            params.put("byteCount", swfSize);
View Full Code Here

Examples of org.apache.flex.swf.io.ISWFWriter

        if (swf != null)
        {
            swf.setTopLevelClass(getSymbolClass());

            final ISWFWriter writer = new SWFWriter(swf, Header.Compression.NONE);
            final String outputFileNameWithExt = outputBaseName + ".swf";
            final File outputFile = new File(outputDirectoryName + outputFileNameWithExt);
            try
            {
                CountingOutputStream output = new CountingOutputStream(
                        new BufferedOutputStream(new FileOutputStream(outputFile)));

                writer.writeTo(output);
                output.flush();
                output.close();
                writer.close();

                out.format("%s, %d bytes written in %5.3f seconds\n",
                        outputFile.toString(),
                        output.getByteCount(),
                        (System.nanoTime() - startTime) / 1e9 );
View Full Code Here

Examples of org.apache.flex.swf.io.ISWFWriter

        final String path = library.getPath();
        assert swf != null : "Expect SWF model";
        assert path != null : "Expect SWF path";

        final OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(new File(directory, path)));
        ISWFWriter swfWriter = swfWriterFactory.createSWFWriter(swf,
                getLibrarySWFCompression(), enableDebug);
        final DigestOutputStream digestStream = getDigestOutputStream(library, outputStream);
       
        swfWriter.writeTo(digestStream != null ? digestStream : outputStream);
        swfWriter.close();
        outputStream.close();

        if (digestStream != null)
            addDigestToLibrary(digestStream, library);
    }
View Full Code Here

Examples of org.apache.flex.swf.io.ISWFWriter

                targetSettings.useCompression(),
                targetSettings.getSWFVersion(),
                targetSettings.isDebugEnabled());
        final ISWFWriterFactory writerFactory = SWFWriterAndSizeReporter.getSWFWriterFactory(
                targetSettings.getSizeReport());
        final ISWFWriter writer = writerFactory.createSWFWriter(swf, compression, targetSettings.isDebugEnabled());
       
        return writer.writeTo(outputFile);
    }
View Full Code Here

Examples of org.apache.flex.swf.io.ISWFWriter

                targetSettings.useCompression(),
                targetSettings.getSWFVersion(),
                targetSettings.isDebugEnabled());
        final ISWFWriterFactory writerFactory = SWFWriterAndSizeReporter.getSWFWriterFactory(
                targetSettings.getSizeReport());
        final ISWFWriter writer = writerFactory.createSWFWriter(swfTarget, compression, targetSettings.isDebugEnabled());
       
        // Write out the SWF, counting how many bytes were written.
        final CountingOutputStream output =
                new CountingOutputStream(outputStream);

        writer.writeTo(output);
        final int swfSize = output.getCount();
        return swfSize;
    }
View Full Code Here

Examples of org.apache.flex.swf.io.ISWFWriter

        final String path = library.getPath();
        assert swf != null : "Expect SWF model";
        assert path != null : "Expect SWF path";

        zipOutputStream.putNextEntry(new ZipEntry(path));
        ISWFWriter swfWriter = swfWriterFactory.createSWFWriter(swf,
                getLibrarySWFCompression(), enableDebug);
        final DigestOutputStream digestStream = getDigestOutputStream(library, zipOutputStream);
        swfWriter.writeTo(digestStream != null ? digestStream : zipOutputStream);
        swfWriter.close();
        zipOutputStream.closeEntry();
       
        if (digestStream != null)
            addDigestToLibrary(digestStream, library);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.