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 zlib and do the inflate work as a DEFLATE format.
My question is how does zlib do inflate work correctly, as the data passed in is not just a raw deflate data? In other words, how does zlib keeps the 8-bytes trailer and not treated it as the data needs to be decompressed?
How does zlib inflate GZIP trailer correctly in JAVA?
235 Views Asked by MO15 At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in COMPRESSION
- Should I compress images in java backend before sending to frontend?
- saving always adds artefacts to my images that photoshop doesn't
- Kafka compression on Broker side
- I am trying to compress video in Android using ffmpeg
- Compress gzip/Deflate string with golang
- how to convert different length of bits into byte array?
- knowledge distillation in a multistep model
- How to decompress the contents of a var to another var?
- Why response body not compressed when use webtestclient?
- How to monkey-patch np.savez_compressed to add compression level, without editing numpy's source files?
- incorrect header check while implementing GZIP in spring boot REST APIs
- Create algorhitm to create .pak file from unpack code
- Problem with decompressing algorithm in firefox (works in chrome/edge)
- Can I ignore some keyword while compressing css file through webpack? In other words I need a loader which just compress my file without validation
- PNG cropping increases file size
Related Questions in ZLIB
- How can I eliminate compile warnings using ZLib in Visual Studio
- problem with decompressing encrypted data in frontend
- C++ how to unzip file
- How can I decompress gzipped http bodies in a nodejs application?
- Unable to build rsyslog with static libz.a (zlib) file
- Missing System.IO.Compression.Native.dll in .NET 8 leads to error when using GZipStream
- Zlib compression in Powershell
- What is going on with the last two lext[] values in zlib?
- Linker can't find zlib or OpenSSL?
- How can i deobfuscate base64 zlib when i have obfuscate method?
- How to fix puppeteer intermittently failing when downloading chrome-headless-shell on CI
- How do I unpack/unzip a "(.TRS/PACK) TERSE compressed data (PACK, V) (2000/1)" file?
- Unresolved external symbol for statically build zlib
- Can't extract squashfs file system using unsquashfs tools
- how to decompress and write to disk lz4 compressed OS image
Related Questions in INFLATE
- how to display image with the best way when downloading image
- How to Reference a Resource File?
- Is there a function for inflate (zlib/miniz) which return upper bound of inflate/decompress size?
- Android layoutinflater on listview not working
- Compressing data
- Java Inflate inconsistent with large Strings
- Open or inflate the Actionbar menu on longclick only - Android
- Getting inflate exception in Android
- JavaScript: Decompress / inflate /unzip /ungzip strings
- zLib inflate has empty result in some cases
- Inflater can't find constructor
- Change text value in inflate layout
- XML Inflater not seeing any of the views?
- Android widget imageswitcher?
- How do Java deflation/inflation streams work?
Related Questions in GZIPINPUTSTREAM
- java.io.EOFException: Unexpected end of ZLIB input stream from API response
- byte array gzip and base64 encoding results in OOM error upon retrieval and decode+unzip at high load
- Failing GZIPInputStream
- Android DeCompress String giving java.util.zip.ZipException: Not in GZIP format
- Not in GZIP format java while reading the zip dynamically
- Do I need to close the GZIPInputStream when unpacking the gzip in a zip file?
- GZIPInputStream.read(...), is reading less number of bytes than supplied length parameter
- How to handle a GZIP String from message body API response?
- InputStream to GZIPInputStream, and I need to know the size of the GZIPInputStream
- Compressing byte[] to byte[] with GZIPOutputStream? Unexpected end of ZLIB input stream
- How to improve java.util.zip.GZIPInputStream performance to unzip a large .gz file?
- Jmeter decompress gzip response
- How does zlib inflate GZIP trailer correctly in JAVA?
- GZIPInputStream memory leakage
- Java TarInputStream read file names of a tar.gz file which included another tar.gz file
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The deflate format is self-terminating. zlib stops decompressing the raw deflate stream until the deflate block marked as the last block is processed. What's left over is the trailer for the Java code to deal with.