T
tanxj
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将SWF文件,文件头为'CWS'的文件解码为文件头为'FWS'的SWF文件。
我这样解码老是出错!!
procedure TMainform.MyZlibFile(FileName : string);
var
IStream : TFilestream;
OStream : TFileStream;
jyl: TDeCompressionStream;
buf: array[1..512] of byte;
sjread: integer;
begin
Istream := TFilestream.Create(FileName,fmOpenRead);//TStream.Create;
OStream := TFileStream.Create(MyPath + '/Temp.swf',fmCreate);
iStream.Position := 20;
jyl := TDeCompressionStream.Create(iStream);
try
repeat
//读入实际大小
showmessage('开始解码');
sjRead := jyl.Read(buf, sizeof(buf));
showmessage('解了');
//老是到不了这一步.
if sjread > 0 then
OStream.Write(buf, sjRead);
until (sjRead = 0);
finally
jyl.Free;
end;
我这样解码老是出错!!
procedure TMainform.MyZlibFile(FileName : string);
var
IStream : TFilestream;
OStream : TFileStream;
jyl: TDeCompressionStream;
buf: array[1..512] of byte;
sjread: integer;
begin
Istream := TFilestream.Create(FileName,fmOpenRead);//TStream.Create;
OStream := TFileStream.Create(MyPath + '/Temp.swf',fmCreate);
iStream.Position := 20;
jyl := TDeCompressionStream.Create(iStream);
try
repeat
//读入实际大小
showmessage('开始解码');
sjRead := jyl.Read(buf, sizeof(buf));
showmessage('解了');
//老是到不了这一步.
if sjread > 0 then
OStream.Write(buf, sjRead);
until (sjRead = 0);
finally
jyl.Free;
end;