IT. Expert System.

Android Reference

GZIPInputStream


java.util.zip

Class GZIPInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable


    public class GZIPInputStream
    extends InflaterInputStream
    The GZIPInputStream class is used to read data stored in the GZIP format, reading and decompressing GZIP data from the underlying stream into its buffer.

    Example

    Using GZIPInputStream is easier than ZipInputStream because GZIP is only for compression, and is not a container for multiple files. This code decompresses the data from a GZIP stream, similar to the gunzip(1) utility.

     InputStream is = ...
     GZIPInputStream zis = new GZIPInputStream(new BufferedInputStream(is));
     try {
         // Reading from 'zis' gets you the uncompressed bytes...
         processStream(zis);
     } finally {
         zis.close();
     }
     
    • Field Detail

      • GZIP_MAGIC

        public static final int GZIP_MAGIC
        The magic header for the GZIP format.
        See Also:
        Constant Field Values
      • crc

        protected CRC32 crc
        The checksum algorithm used when handling uncompressed data.
      • eos

        protected boolean eos
        Indicates the end of the input stream.
    • Constructor Detail

      • GZIPInputStream

        public GZIPInputStream(InputStream is)
                        throws IOException
        Construct a GZIPInputStream to read from GZIP data from the underlying stream.
        Parameters:
        is - the InputStream to read data from.
        Throws:
        IOException - if an IOException occurs.
      • GZIPInputStream

        public GZIPInputStream(InputStream is,
                       int size)
                        throws IOException
        Construct a GZIPInputStream to read from GZIP data from the underlying stream. Set the internal buffer size to size.
        Parameters:
        is - the InputStream to read data from.
        size - the internal read buffer size.
        Throws:
        IOException - if an IOException occurs.
    • Method Detail

      • read

        public int read(byte[] buffer,
               int offset,
               int byteCount)
                 throws IOException
        Reads and decompresses GZIP data from the underlying stream into the given buffer.
        Overrides:
        read in class InflaterInputStream
        Parameters:
        buffer - the byte array in which to store the bytes read.
        offset - the initial position in buffer to store the bytes read from this stream.
        byteCount - the maximum number of bytes to store in buffer.
        Returns:
        Number of uncompressed bytes read
        Throws:
        IOException - if this stream is closed or another I/O error occurs.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 64 / 158749416. Delta: 0.05620 с