<WebMethod(Description:="Get various data tables - down only")> _
Public Function GetGZippedDataTEST() As String
Dim _encodedString As Byte() = Encoding.UTF8.GetBytes("Test text")
Dim _memoryStream As MemoryStream = New MemoryStream()
Dim _gZipStream As GZipStream = New GZipStream(_memoryStream, CompressionMode.Compress, True)
_gZipStream.Write(_encodedString, 0, _encodedString.Length)
_memoryStream.Position = 0
Dim _compressedData As Byte() = New Byte(_memoryStream.Length - 1) {}
' Fill the compressed data byte array
_memoryStream.Read(_compressedData, 0, _compressedData.Length)
' Add the length of the original byte array to the start of the output byte array
Dim _amendedByteArray As Byte() = New Byte(_compressedData.Length + 3) {}
System.Buffer.BlockCopy(_compressedData, 0, _amendedByteArray, 4, _compressedData.Length)
System.Buffer.BlockCopy(BitConverter.GetBytes(_encodedString.Length), 0, _amendedByteArray, 0, 4)
Return Convert.ToBase64String(_amendedByteArray)
End Function