使用方法如下:
源代码打包上传,欢迎下载使用.
源代码下载地址
http://download.youkuaiyun.com/detail/aerror/3898251
public static function decode(src:ByteArray) : ByteArray
{
if (src == null || src.length < 16)
{
return null;
}
var inStream:InputStream = new InputStream(src);
var propertiesSize:int = 5;
var properties:Vector.<uint> = new Vector.<uint>(propertiesSize);
if (inStream.readVOL(properties, 0, propertiesSize) != propertiesSize)
return null;
var decoder:Decoder = new Decoder();
if (!decoder.SetDecoderProperties(properties))
return null;
var outSize:uint = 0;
for (var i:int = 0; i < 8; i++)
{
var v:int = inStream.read();
if (v < 0)
return null;
outSize |= (v << (8 * i));
}
var ret:ByteArray = new ByteArray();
ret.length = outSize;
var outStream:OutputStream = new OutputStream(ret);
if (!decoder.Code(inStream, outStream, outSize))
return null;
inStream.close();
outStream.close();
ret.position =0;
return ret;
}
本文介绍了一种源代码的解码与转换方法,包括输入流读取、解码器配置、输出流生成等关键步骤,适用于源代码的高效处理。
1229

被折叠的 条评论
为什么被折叠?



