Torna al Thread

Public Shared Function Decompress(ByVal data As Byte()) As Byte() Dim input As MemoryStream = New MemoryStream input.Write(data, 0, data.Length) input.Position = 0 Dim gzip As IO.Compression.GZipStream = New IO.Compression.GZipStream(input, Compression.CompressionMode.Decompress, True) Dim output As MemoryStream = New MemoryStream Dim buff(64) As Byte Dim read As Integer = -1 read = gzip.Read(buff, 0, buff.Length) While read > 0 output.Write(buff, 0, read) read = gzip.Read(buff, 0, buff.Length) End While gzip.Close() Return output.ToArray End Function
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5