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
0
votes
0 answers

Do I need to close the GZIPInputStream when unpacking the gzip in a zip file?

sample code: import java.io.*; import java.util.zip.*; public class Main { public static void main(String[] args) throws IOException { try(FileInputStream fileInputStream = new FileInputStream("xxx.zip"); ZipInputStream…
Guo
  • 1,761
  • 2
  • 22
  • 45
0
votes
1 answer

GZIPInputStream.read(...), is reading less number of bytes than supplied length parameter

I have a .gz file which I'm trying to read using GZIPInputStream, fixed number of bytes at a time. I am using GZIPInputStream.read(byte[] buf, int off, int len) (ref: doc) to do this. But the method is reading only 397 bytes(return value of the…
Sriman
  • 87
  • 1
  • 5
0
votes
2 answers

InputStream to GZIPInputStream, and I need to know the size of the GZIPInputStream

I have a MultipartFile and I need to compress inputStream as gzip and sent it, but I need to find a way to compress it and know the compressed size of it param: MultipartFile file try(var inputStream = file.getInputStream()) { …
0
votes
2 answers

Compressing byte[] to byte[] with GZIPOutputStream? Unexpected end of ZLIB input stream

I am trying to compress and array of bytes into another array of bytes using GZIPOutputStream (in Java). This is my code: @Test public void testCompressBytes() throws IOException { final byte[] uncompressed =…
0
votes
0 answers

java.lang.OutOfMemoryError: Java heap space when reading file_name.txt.gz file

We have implemented Azure Event hub Streaming job which reads .gz files stored in Azure blob (text files compressed to gz) extracts it and performs some business logic. Below is the code written to extract the file. try (BlobInputStream…
chandu ram
  • 251
  • 2
  • 5
  • 19
0
votes
1 answer

Jmeter decompress gzip response

I write performance test script with JMeter, but the target site using gzip to compress response. So Jmeter can't display any response and only show EOFException. java.io.EOFException at…
J.S Lee
  • 29
  • 2
  • 9
0
votes
1 answer

How does zlib inflate GZIP trailer correctly in JAVA?

When using GZIPInputStream in JAVA, it is not passing the whole buffer to zlib and inflate it as a GZIP format. Instead, It seems that GZIP header is been processed in JAVA side, and then pass the remaining part(raw deflate data + GZIP trailer)to…
MO15
  • 23
  • 3
0
votes
1 answer

Java TarInputStream read file names of a tar.gz file which included another tar.gz file

I'm trying to get file names of a tar.gz file inside another tar.gz file. Here is the sample code; try (TarInputStream tis = getStreamRemoteTarGz(url)) { // accessing the first tar.gz file TarEntry e; while ((e = tis.getNextEntry()) != null)…
Oguz Aktas
  • 27
  • 2
  • 8
0
votes
1 answer

Can't decompress data with GZipStream without running into exceptions, can't determine cause

In a Blazor WebAssembly project I'm working on, I am compressing data at a back-end WebAPI server and passing it up to the front-end Blazor server (running Blazor WebAssembly, not "Blazor Server," yay for confusing terminology), to be delivered to…
Codefun64
  • 593
  • 2
  • 9
  • 18
0
votes
1 answer

Extract GZ file with Java

I'm trying to extract a CSV file from a GZ file. So far, I've tried the following ways to make this operation: Archiver archiver = ArchiverFactory.createArchiver(null, CompressionType.GZIP); archiver.extract(archiveFile,…
Manitoba
  • 8,522
  • 11
  • 60
  • 122
0
votes
0 answers

read zipped ion content from s3 in java

I have a backend service that writes a file created using GZipOutputStream to S3 and the front end wants to display the ION content in it. I tried using GZipInputStream to wrap the InputStream returned by the S3Object getObjectContent() method, but…
0
votes
0 answers

Gzip file is getting corrupted while uploading it into S3 bucket using Java application

I am uploading a gzip file into S3 bucket using java application, the data of which will be used in Athena. The gzip file is getting corrupted while uploading. Due to which Athena is unable to view the data from the gzip file, also when the file is…
0
votes
2 answers

OOM when trying to process s3 file

I am trying to use below code to download and read data from file, any how this goes OOM, exactly while reading the file, the size of s3 file is 22MB, I downloaded through browser it is 650 MB, but when I monitor through visual VM, memory consumed…
Aadam
  • 1,521
  • 9
  • 30
  • 60
0
votes
0 answers

Uncompress Gzip data using SQL

We have a service which store the compressed data in the data store(SQL table). This data is compressed using java util library GZIPOutputStream. My question is is there a way to uncompress this data using SQL? Sample compressed…
Jhutan Debnath
  • 505
  • 3
  • 13
  • 24
0
votes
1 answer

Spring integration Unzip transformer throws ReplyRequiredException exception

We would like to decompress a byte array using Spring Integration and are experiencing the following exception upon using unzip-transformer: org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler…
1 2 3
8 9