473,379 Members | 1,216 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,379 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 1837

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...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.