Bonjour à tous,

Je cherche à compresser un tableau d'octets:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
byte[] Compress(byte[] oByteTab)
{
    MemoryStream oMemoryStream = new MemoryStream();
    DeflateStream oDeflatStream = new DeflateStream(oMemoryStream, CompressionMode.Compress);
    oDeflatStream.Write(oByteTab, 0, oByteTab.Length);
    oDeflatStream.Flush();
    oDeflatStream.Close();
    byte[] oResult = oMemoryStream.ToArray();
    return oResult;
}
Le souci vient du fait que pour un tableau de 1024 octets passé, la fonction renvoi un tableau de 1660 octets...

Qué passa?


Merci beaucoup

A bientôt