请问下面的C#代码怎么用C(不是C++)改写,使用zlib 1.2.3
public static byte[] CompressZip(byte[] abyte0)
{
Crc32 crccalculator = new Crc32();
crccalculator.Update(abyte0);
int crclength = IBEClient.gbk.GetBytes(crccalculator.Value.ToString()).Length;
ZipEntry entry = new ZipEntry(abyte0.Length.ToString() + “.” + crclength);
MemoryStream byas = new MemoryStream();
ZipOutputStream outs = new ZipOutputStream(byas);
outs.SetLevel(9);
outs.PutNextEntry(entry);
for (int i = 0; i < abyte0.Length; i += 2048)
outs.Write(abyte0, i, i + 2048 >
abyte0.Length ? abyte0.Length – i : 2048);
byte[] bys = IBEClient.gbk.GetBytes(crccalculator.Value.ToString());
outs.Write(bys, 0, bys.Length);
outs.Close();
return byas.ToArray();
}
>> 本文固定链接: http://www.vcgood.com/archives/2147