介绍一个轻量级java的swf处理库

http://dennis-zane.iteye.com/blog/153678


提取swf文件元信息、压缩swf、解压swf都可以处理,来自于http://www.brooksandrus.com/blog/category/java/,或者直接这里下载。

一个小例子:
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()); 


   
压缩、解压缩,需要注意生成的文件将覆盖原文件:
Java代码

    //压缩  
   SWFCompressor compressor=new SWFCompressor("G:\\test.swf");  
    //解压缩  
    SWFDecompressor decompressor=new SWFDecompressor("G:\\test.swf");  

//压缩
SWFCompressor compressor=new SWFCompressor("G:\\test.swf");
//解压缩
SWFDecompressor decompressor=new SWFDecompressor("G:\\test.swf");


 

你可能感兴趣的:(java,Blog)