I'm reading a .gz file from some slow source (like FTP Server) and am processing the received data right away. Looks something like this:
FtpWebResponse response = ftpclientRequest.GetResponse() as FtpWebResponse;
using (Stream ftpStream = response.GetResponseStream())
using (GZipStream unzipped = new GZipStream(ftpStream, CompressionMo...
How do I read / write gzipped files in C++?
The iostream wrapper classes here look good, and here is a simple usage example:
gz::igzstream in(filename);
std::string line;
while(std::getline(in, line)){
std::cout << line << std::endl;
}
But I wasn't able to actually link it (although I have a /usr/lib/libz.a). A simple
g++ test-gzs...
I'm trying to decompress a GZipStream. The problem is that the "Length" property on the stream throws a "NotSupported" exception. How do I know what size to make my buffer when I'm reading the bytes from the stream? Since it's compressed I don't know how large the uncompressed version will be. Any suggestions?
...
Hello Folks,
I have a file in .gz format. The java class for reading this file is GZIPInputStream.
However, this class doesn't extend the BufferedReader class of java. As a result, I am not able to read the file line by line. I need something like this
reader = new MyGZInputStream( some constructor of GZInputStream)
reader.readLine...
I have a large amount of data (~100k) that my C# app is sending to my Apache server with mod_gzip installed. I'm attempting to gzip the data first using System.IO.Compression.GZipStream. PHP receives the raw gzipped data, so Apache is not uncompressing it as I would expect. Am I missing something?
System.Net.WebRequest req = WebRequest....
Hi all,
I have a server that basically caters to multiple clients.
I am basically using gzip(input/output)stream to compress the data between client-server.
Many clients can send the requests to server at the same time and hence i have a thread to cater to each client.
Now, the problem tat i am experiencing is that "randomly" some cli...
Hello.. I am trying to decompress a (.gz) file using the GZipStream class that is included in the .NET framework. I am using the MSDN documentation and I keep getting this exception: "Writing to the compression stream is not supported."
Here is the application source:
try
{
var infile = new FileStream(@"C:...
I have a situation where a servlet is providing compressed data to a PHP script. I compress the data on the Java side no problem, but PHP seems unable to decompress.
Here is the relevent code snippets
Java Side:
OutputStream o=response.getOutputStream();
GZIPOutputStream gz=new GZIPOutputStream(o);
gz.write(GridCoder.encode(rs,id...
I have a Base64 string that's been gzipped in .NET and I would like to convert it back into a string in Java. I'm looking for some Java equivalents to the C# syntax, particularly:
Convert.FromBase64String
MemoryStream
GZipStream
Here's the method I'd like to convert:
public static string Decompress(string zipText) {
byte[] gzipB...
Are there any GZIPInputStream implementation for J2ME available. I would prefer an Apache Style License
...
I have a .NET 2.0 WinForms app that connects to a backend WAS server. I am using GZipStream to decode data coming back from a HttpWebRequest call made to the server. The data returned is compressed CSV, which Apache is compressing. The entire server stack is Hibernate-->EJB-->Spring-->Apache.
For small responses, the performance is f...
I have code that should do the compression:
FileStream fs = new FileStream("g:\\gj.txt", FileMode.Open);
FileStream fd = new FileStream("g:\\gj.zip", FileMode.Create);
GZipStream csStream = new GZipStream(fd, CompressionMode.Compress);
byte[] compressedBuffer = new byte[500];
int offset = 0;
...
What is wrong with this code below. I always get FALSE, meaning after compression, decompressed data does not match original value.
public static bool Test()
{
string sample = "This is a compression test of microsoft .net gzip compression method and decompression methods";
System.Text.ASCIIEncoding encodi...
Hi All-
I'm reading a file(a flash swf) from .Net 3.5 that has a header which states whether the body of the file/Stream is compressed or not. However, I'm having problems-after I rewrap the basic File stream in a GZipStream, I get an exception stating that "The magic number in GZip header is not correct. Make sure you are passing in a...
I am receiving a TGZ file that will contain one plain text file along with possibly one or more nested TGZ files. I have figured out how to decompress the main TGZ file and read the plain text file contained in it, but I have not been able to figure out how to recognize and decompress the nested TGZ files. Has anyone come across this p...
Hi folks,
Does anyone know how to get access to request HTTP headers within MessageEncoder.ReadMessage method?
It seems that WCF already "knows" request headers at the point of invoking ReadMessage method, at least Content-Type and Content-Length but I cannot get the access to the Content-Encoding header.
Basically, I'm trying to utili...
I am using the following code to write to a compressed file that I create new everytime.
using (FileStream fs = File.Open(sortOrderFileName, FileMode.Create,FileAccess.Write, FileShare.ReadWrite))
using (System.IO.Compression.GZipStream gzip = new System.IO.Compression.GZipStream(fs, System.IO.Compression.CompressionMode.Compress))
usin...
The data that I am posting from a VB.Net client is large and I want to compress.
I want to do a "POST" and the apache server supports mod_deflate.
I am trying to integrate DeflateStream into my post code, however does not seem to be working.
I can send the data without compression using the standard code.
request.ContentType = "a...
I plan to configure weblogic's gzip servlet filter (using weblogicx-gzip.jar) to gzip my web pages.
How can I verify that the pages are being sent to the client gzipped?
...
hi all, i am trying to use GZipStream to create a gz file using c#.
my problem is that i have a list that contains strings. and i need to create a password protected zip file, and put in it a text file containing the strings.
i don't want to create the textfile, then zip it, and then delete the textfile. i want to directly create a passw...