Added in API level 1

GZIPInputStream

open class GZIPInputStream : InflaterInputStream
kotlin.Any
   ↳ java.io.InputStream
   ↳ java.io.FilterInputStream
   ↳ java.util.zip.InflaterInputStream
   ↳ java.util.zip.GZIPInputStream

This class implements a stream filter for reading compressed data in the GZIP file format.

Summary

Constants
static Int

GZIP header magic number.

Public constructors

Creates a new input stream with a default buffer size.

Creates a new input stream with the specified buffer size.

Public methods
open Unit

Closes this input stream and releases any system resources associated with the stream.

open Int
read(buf: ByteArray!, off: Int, len: Int)

Reads uncompressed data into an array of bytes.

Inherited functions
Properties
CRC32!

CRC-32 for uncompressed data.

Boolean

Indicates end of input stream.

Inherited properties

Constants

GZIP_MAGIC

Added in API level 1
static val GZIP_MAGIC: Int

GZIP header magic number.

Value: 35615

Public constructors

GZIPInputStream

Added in API level 1
GZIPInputStream(in: InputStream!)

Creates a new input stream with a default buffer size.

Parameters
in InputStream!: the input stream
Exceptions
java.io.IOException if an I/O error has occurred
java.util.zip.ZipException if a GZIP format error has occurred or the compression method used is unsupported

GZIPInputStream

Added in API level 1
GZIPInputStream(
    in: InputStream!,
    size: Int)

Creates a new input stream with the specified buffer size. Android-note: Android limits the number of UnbufferedIO operations that can be performed, so consider using buffered inputs with this class. More information can be found in the UnbufferedIO and StrictMode documentation.

Parameters
in InputStream!: the input stream
size Int: the input buffer size
Exceptions
java.io.IOException if an I/O error has occurred
java.lang.IllegalArgumentException if size <= 0
java.util.zip.ZipException if a GZIP format error has occurred or the compression method used is unsupported

Public methods

close

Added in API level 1
open fun close(): Unit

Closes this input stream and releases any system res