Close() public méthode

public Close ( ) : void
Résultat void
Exemple #1
0
 /** A helper to FlateDecode.
 * @param in the input data
 * @param strict <CODE>true</CODE> to read a correct stream. <CODE>false</CODE>
 * to try to read a corrupted stream
 * @return the decoded data
 */    
 public static byte[] FlateDecode(byte[] inp, bool strict) {
     MemoryStream stream = new MemoryStream(inp);
     ZInflaterInputStream zip = new ZInflaterInputStream(stream);
     MemoryStream outp = new MemoryStream();
     byte[] b = new byte[strict ? 4092 : 1];
     try {
         int n;
         while ((n = zip.Read(b, 0, b.Length)) > 0) {
             outp.Write(b, 0, n);
         }
         zip.Close();
         outp.Close();
         return outp.ToArray();
     }
     catch {
         if (strict)
             return null;
         return outp.ToArray();
     }
 }