fhigit / text20

Automatically exported from code.google.com/p/text20
0 stars 0 forks source link

Session XML output should be compressed #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now a plain XML stream is written, but that gets big pretty soon. We 
should investigate if stream-compression is suitable and robust (browsers quit 
quite fast). 

Original issue reported on code.google.com by r.biedert on 6 Aug 2010 at 9:58

GoogleCodeExporter commented 9 years ago
Apparently it is not that easy, because both ZLib and the GZip method fail when 
decompressing truncated files (error: oversubscribed literal/length tree)

Original comment by r.biedert on 6 Aug 2010 at 11:44

GoogleCodeExporter commented 9 years ago
Mmhm, according to Jörn it should work (at least his test cased worked). 
Should investigate this further. In his case he used

PrintStream gos = new PrintStream(new GZIPOutputStream(new 
FileOutputStream("testfile.gz")), true);
BufferedReader br = new BufferedReader(new InputStreamReader(new 
GZIPInputStream(new FileInputStream("testfile_a.gz"))));

and split the file on Linux using 'split -b xxx'. The only exception thrown was 
EoFException, unexpected end of input stream.. 

Original comment by r.biedert on 22 Sep 2010 at 12:56

GoogleCodeExporter commented 9 years ago
Just tested decorating the output stream with a GZipOutputStream.

I can verify Jörn's findings:

When the stream is closed normally the gz file is perfectly ok... If the 
browser crashes or is closed leaving the JVM no time to shut down correctly, 
the generated file naturally is broken at the end as expected with an EOF 
error...

Original comment by arman.va...@gmail.com on 27 Sep 2010 at 6:22

GoogleCodeExporter commented 9 years ago
Fixed this issue, i.e. xstreams are written and can be read as gzip files.

Just a way to determine the desires output format is needed.

Original comment by arman.va...@gmail.com on 27 Sep 2010 at 9:40

GoogleCodeExporter commented 9 years ago
Added a hard coded compression flag in SessionStreamer.Java which is currently 
set to true (i.e. all streams get compressed).

Original comment by arman.va...@gmail.com on 27 Oct 2010 at 1:49