ca ne marche pas -> decompression stream
Bonjour,
ca ne marche pas.
Decompression marche pas.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
static void Main(string[] args)
{
MemoryStream memzip = new MemoryStream();
{
MemoryStream mem = new MemoryStream();
mem.Seek(10000, SeekOrigin.Begin);
byte[] buf = new byte[16];
for (int i = 0; i < 16; i++)
buf[i] = (byte)i;
mem.Write(buf, 0, 16);
mem.Position = 0;
GZipStream ds = new GZipStream(memzip, CompressionMode.Compress);
mem.CopyTo(ds);
///ds.Close();
// mem.Close();
}
memzip.Position = 0;
{
MemoryStream mem = new MemoryStream();
GZipStream ds = new GZipStream(memzip, CompressionMode.Decompress);
ds.CopyTo(mem);
mem.Seek(10000 - 2, SeekOrigin.Begin);
byte[] buf = new byte[20];
int ci= mem.Read(buf, 0, 16);
ds.Close();
}
memzip.Close();
}
} |
ci égal à 0 et ca ne lit aucune données
buf[2] doit étre égal à 0
buf[3] doit être égal à 1
Merci