提取swf文件元信息、压缩swf、解压swf都可以处理,来自于http://www.brooksandrus.com/blog/category/java/,或者直接这里下载。
一个小例子:
System.out.println("signature: " + header.getSignature());
System.out.println("version: " + header.getVersion());
System.out.println("compression: " + header.getCompressionType());
System.out.println("size: " + header.getSize());
System.out.println("nbits: " + header.getNbits());
System.out.println("xmax: " + header.getXmax());
System.out.println("ymax: " + header.getYmax());
System.out.println("width: " + header.getWidth());
System.out.println("height: " + header.getHeight());
System.out.println("frameRate: " + header.getFrameRate());
System.out.println("frameCount: " + header.getFrameCount());
压缩、解压缩,需要注意生成的文件将覆盖原文件:
SWFCompressor compressor=new SWFCompressor("G:\\mplayer\\test.swf");
//解压缩
SWFDecompressor decompressor=new SWFDecompressor("G:\\mplayer\\test.swf");