473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Base64 encoded compressed webresponse

BW
Sorted my problem.

Issue - retrieve Base64 encoded Zlib compressed XML stream.

The compressed XML stream was compressed using Zlib on a Java
platform.

Resolution. (VB.NET)

1) Retrieve XML stream using webresponse class
2) Convert the base64 encoded stream into a byte array
3) Feed the byte array into the amazing SharpZipLib C# library
developed by Mike Krueger. (available at
http://www.icsharpcode.net/OpenSource/SharpZipLib/)
4) Retirieved the resulting byte array into a string.

Code in VB.NET is below (steps 2-4)

'string containing data
dim b64stringas string = "mybase64encoded_compressed_string"
'decode base64 encoded string into a bte array
Dim data() As Byte = Convert.FromBase64String(b64string)
'declare my variables for using the SharpZipLib componant
dim strresult as String
dim totalLength as long= 0
dim writedata(4096) as Byte
dim size as Integer
'make memory stream to feed into InflaterInputStream
dim s2 as Stream = new
ICSharpCode.SharpZipLib.Zip.Compression.Streams.In flaterInputStream(new
MemoryStream(data1))
do while true
size = s2.Read(writeData, 0, writeData.Length)
if (size > 0)
strResult+=System.Text.Encoding.UTF8.GetString(wri teData,
0,size)
else
exit Do
End If
Loop
'write the results out to a file
Dim objReader As StreamWriter
objReader = New StreamWriter("c:\hereyougo.txt")
objReader.Write(strresult)
objReader.Close()
Nov 22 '05 #1
0 1836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
I am trying to integrate my ASP page with an external application that sends me a QueryString that is URLEncoded and each Name and Value in the QueryString is Base64 Encoded as well. ...
0
by: BW | last post by:
Sorted my problem. Issue - retrieve Base64 encoded Zlib compressed XML stream. The compressed XML stream was compressed using Zlib on a Java platform. Resolution. (VB.NET) 1) Retrieve...
27
by: gRizwan | last post by:
Hello all, We have a problem on a webpage. That page is sent some email data in base64 format. what we need to do is, decode the base64 data back to original shape and extract attached image...
4
by: John | last post by:
Hi all, I've been going through google and yahoo looking for a certain base64 decoder in C without success. What I'm after is something that you can pass a base64 encoded string into and get back...
6
by: Chris Fink | last post by:
I have an xml document that contains some elements encoded as Base64. How do I dynamically scan the XML Document and pull out the sections that are Base64... My overall goal is to display the...
2
by: kevin | last post by:
DISCLAIMER: I know what the words mean (i.e. by definition), but I in know way pretend to understand the specifics of either, therefore I may need a basic primer before I can accomplish this task,...
0
by: Phil C. | last post by:
(Cross post from framework.aspnet.security) Hi. I testing some asp.net code that generates a 256 bit Aes Symmetric Key and a 256 bit entropy value. I encrypt the Aes key(without storing it as...
7
by: Neo Geshel | last post by:
Greetings. I have managed to stitch together an awesome method of posting text along with an image to a database, in a way that allows an unlimited number of previews to ensure that text and...
14
by: BB | last post by:
Hello. i am trying to decode a block of (what i think is) base64 into text, and i have NO idea how to begin. I'm going to paste the whole string here, but i want to know the steps necessary to...
13
by: aruna.eies.eng | last post by:
i am currently trying to convert data into binary data.for that i need to know how to achieve it in c language and what are the libraries that we can use. so if any one can send me a sample code or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.