Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function Decompress() As Boolean
- 'Dim str As New String(Microsoft.VisualBasic.CompilerServices.Conversions.ToCharArrayRankOne(OFD.FileName & "\Extracted"))
- Dim stream2 As New MemoryStream(File.ReadAllBytes(filepath))
- Dim stream As New GZipStream(stream2, CompressionMode.Decompress)
- Dim buffer As Byte() = New Byte(3) {}
- stream2.Position = stream2.Length - 4L
- stream2.Read(buffer, 0, 4)
- Dim count As Integer = CInt(BitConverter.ToUInt32(buffer, 0))
- stream2.Position = 0L
- Dim array As Byte() = New Byte((count - 1)) {}
- stream.Read(array, 0, count)
- stream.Dispose()
- stream2.Dispose()
- File.WriteAllBytes(Application.StartupPath + "\" + "extracted", array)
- End Function
Add Comment
Please, Sign In to add comment