N
Nikk & Jak Anderson
Hi,
I have an applicaiton that stores data sent to it. Storing as ASCII is
very large, so I decided to write the data to a gzip output stream.
THis is fine - using gunzip on Solaris, or zip on windows shows all
the data in the file. However, when I try and read the file in a Java
app, I only get the first few lines.
When creting the zip file, I am appending to an existing file - here
is how I make the input stream (this is compiled using jdk1.4):
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new
GZIPOutputStream(new FileOutputStream(filename, true))));
bw.write("MyData........etc......\r\n");
bw.close();
This works fine, and I get a gzip file that grows as more input is
added - exactly what I need.
Now, for reading the file I use the following readers:
BufferedReader br = new BufferedReader(new InputStreamReader(new
GZIPInputStream(new FileInputStream(FileObject))));
I read the data with the following:
while( (line = br.readLine()) != null){
System.out.println(""+line);
}
I have an applicaiton that stores data sent to it. Storing as ASCII is
very large, so I decided to write the data to a gzip output stream.
THis is fine - using gunzip on Solaris, or zip on windows shows all
the data in the file. However, when I try and read the file in a Java
app, I only get the first few lines.
When creting the zip file, I am appending to an existing file - here
is how I make the input stream (this is compiled using jdk1.4):
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new
GZIPOutputStream(new FileOutputStream(filename, true))));
bw.write("MyData........etc......\r\n");
bw.close();
This works fine, and I get a gzip file that grows as more input is
added - exactly what I need.
Now, for reading the file I use the following readers:
BufferedReader br = new BufferedReader(new InputStreamReader(new
GZIPInputStream(new FileInputStream(FileObject))));
I read the data with the following:
while( (line = br.readLine()) != null){
System.out.println(""+line);
}