Posted on 2008-01-04 11:46
dennis 阅读(2990)
评论(3) 编辑 收藏 所属分类:
java
提取swf文件元信息、压缩swf、解压swf都可以处理,来自于http://www.brooksandrus.com/blog/category/java/,或者直接
这里下载。
一个小例子:
SWFHeader header = new SWFHeader("G:\\mplayer\\test.swf");
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");