Questions tagged [gzipinputstream]

GzipInputStream is a Java class for reading data that are compressed in gzip format. It is also available on Android.

GzipInputStream is a Java class for reading data that are compressed in gzip format. It is also available on Android.

On .NET, there is a similar class called GZipStream: use

125 questions
2
votes
2 answers

Uploading large gzipped data files to HDFS

I have a use case where I want to upload big gzipped text data files (~ 60 GB) on HDFS. My code below is taking about 2 hours to upload these files in chunks of 500 MB. Following is the pseudo code. I was chekcing if somebody could help me reduce…
user656189
  • 139
  • 8
  • 17
2
votes
1 answer

How to fix EOF read error with GZIPInputStream

I am trying to read the contents of a gzip file and create a file from it. I'm running into an issue that I can't see to figure out. Any ideas of suggestion is appreciated. Thank you. private static String unzip(String gzipFile, String location){ …
Kaleb Blue
  • 487
  • 1
  • 5
  • 20
2
votes
2 answers

C# MemoryStream & GZipInputStream: Can't .Read more than 256 bytes

I'm having a problem with writing an uncompressed GZIP stream using SharpZipLib's GZipInputStream. I only seem to be able to get 256 bytes worth of data with the rest not being written to and left zeroed. The compressed stream (compressedSection)…
sega
  • 33
  • 5
2
votes
0 answers

commons-io: java.io.EOFException: Unexpected end of ZLIB input stream

I'm using the Apache library commons-io in verion 2.6 to parse a zip stream and get its bytes. But when I call IOUtils.toByteArray(zipStreamObject) I get a java.io.EOFException: Unexpected end of ZLIB input stream. Here's my code: public static void…
R. Karlus
  • 2,094
  • 3
  • 24
  • 48
2
votes
3 answers

Android: decompress string that was compressed with PHP gzcompress()

How can i decompress a String that was zipped by PHP gzcompress() function? Any full examples? thx I tried it now like this: public static String unzipString(String zippedText) throws Exception { ByteArrayInputStream bais = new…
nr1
  • 133
  • 2
  • 6
2
votes
2 answers

java.io.EOFException: Unexpected end of ZLIB input stream reading gzip encoded website

I am having trouble with the compression of some websites. The following code should work fine, but throws an EOFException. All major browsers can load the site and I also have no problem using curl with gzip. public static void main(String[] args)…
Ph3n1x
  • 307
  • 7
  • 13
2
votes
0 answers

How to download libraries from JNLP file

I'm trying to load a specific JNLP file from a Java program and get its .jar files. I've downloaded the .pack.gz files (because it uses compressing), but now I can't unpack them. I'm trying it by using the class java.util.jar.Pack200.Unpacker, but…
nicovell3
  • 60
  • 8
2
votes
2 answers

Java java.io.IOException: Not in GZIP format

I searched for an example of how to compress a string in Java. I have a function to compress then uncompress. The compress seems to work fine: public static String encStage1(String str) { String format1 = "ISO-8859-1"; String…
TenG
  • 3,843
  • 2
  • 25
  • 42
2
votes
2 answers

truncated output from GZIPInputStream on Android

I must be doing something really wrong. Running following code on Android it produces truncated file (_items_) without any exceptions or problems in the log. Running the same code with OpenJDK 7 it decompresses the file correctly. try { final…
Martin Ždila
  • 2,998
  • 3
  • 31
  • 35
2
votes
1 answer

GZIPInputStream - Corrupt GZIP Trailer

I have a static helper method responsible for getting a compressed JSON string from our Rails application, and decompressing the data before returning a String representation. I wrote two JUnit tests that, one that tests that the JSON parses…
Paul Richter
  • 10,908
  • 10
  • 52
  • 85
2
votes
1 answer

How to improve the perfomance to read the file in tar.gz folder?

I have successfully read pdf file in tar.gz format folder . But I faced performance issue - taking more time to open tar.gz folder containing more than 1000 small pdf files each file size 10 - 25 MB .Total size of the folder is 2GB How to improve…
Godwin Thaya
  • 35
  • 1
  • 9
2
votes
2 answers

How should I handle decompression of a large (70MB uncompressed) byte stream without overflowing heap?

I'm working on implementing GZIP compression for interactions between some of our systems. The systems are written in both Java and C#, so GZIP streams were used on both sides since they have standard library support. On the C# side, everything…
Dan
  • 3,246
  • 1
  • 32
  • 52
2
votes
6 answers

read gzip file to byte[] all at once

in code GZIPInputStream gzis= new GZIPInputStream(bais); byte[] bBodyUnzipped= new byte[10240]; gzis.read(bBodyUnzipped); , how can I optimize the disk space usage and not create a big byte[] by knowing the file unzipped length? According to this…
Andreu Alcon
  • 217
  • 3
  • 13
2
votes
1 answer

Graylog server fails to read Gelf message over TCP :: GELFDispatcher - Could not handle GELF message :: Failed to decompress the GELF message payload

I am trying to write the following json over tcp to graylog server: {"facility":"GELF","file":"","full_message":"Test Message Tcp","host":"FShabesta-12097","level":3,"line":"","short_message":"Test Message…
kaptan
  • 3,060
  • 5
  • 34
  • 46
1
vote
1 answer

Reading Last *n* lines from GZIPInputStream

I am reading a huge txt file inside zip. GZIPInputStream fstream = new GZIPInputStream(new FileInputStream(zipfile)); BufferedReader breader = new BufferedReader(new InputStreamReader(fstream)); I need to read last n lines, of the file. Is it…
kenny
  • 2,000
  • 6
  • 28
  • 38
1 2
3
8 9