Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function Compress(ByVal Data As Byte()) As Byte()
- Using DataStream As New MemoryStream(Data)
- Using CompressedStream As New MemoryStream
- Using CompressionStream As New DeflateStream(CompressedStream, CompressionMode.Compress)
- DataStream.CopyTo(CompressionStream)
- End Using
- Return CompressedStream.ToArray
- End Using
- End Using
- End Function
- Public Function Decompress(ByVal Data As Byte()) As Byte()
- Using DataStream As New MemoryStream(Data)
- Using DecompressedStream As New MemoryStream()
- Using DecompressionStream As New DeflateStream(DataStream, CompressionMode.Decompress)
- DecompressionStream.CopyTo(DecompressedStream)
- End Using
- Return DecompressedStream.ToArray
- End Using
- End Using
- End Function
Advertisement
Add Comment
Please, Sign In to add comment