IT. Expert System.

Android Reference

GZIPOutputStream


java.util.zip

Class GZIPOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable


    public class GZIPOutputStream
    extends DeflaterOutputStream
    The GZIPOutputStream class is used to write data to a stream in the GZIP storage format.

    Example

    Using GZIPOutputStream is a little easier than ZipOutputStream because GZIP is only for compression, and is not a container for multiple files. This code creates a GZIP stream, similar to the gzip(1) utility.

     OutputStream os = ...
     byte[] bytes = ...
     GZIPOutputStream zos = new GZIPOutputStream(new BufferedOutputStream(os));
     try {
         zos.write(bytes);
     } finally {
         zos.close();
     }
     
    • Field Detail

      • crc

        protected CRC32 crc
        The checksum algorithm used when treating uncompressed data.
    • Constructor Detail

      • GZIPOutputStream

        public GZIPOutputStream(OutputStream os)
                         throws IOException
        Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream.
        Parameters:
        os - the OutputStream to write data to.
        Throws:
        IOException - if an IOException occurs.
      • GZIPOutputStream

        public GZIPOutputStream(OutputStream os,
                        int size)
                         throws IOException
        Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream. Set the internal compression buffer to size size.
        Parameters:
        os - the OutputStream to write to.
        size - the internal buffer size.
        Throws:
        IOException - if an IOException occurs.
    • Method Detail

      • finish

        public void finish()
                    throws IOException
        Indicates to the stream that all data has been written out, and any GZIP terminal data can now be written.
        Overrides:
        finish in class DeflaterOutputStream
        Throws:
        IOException - if an IOException occurs.
      • write

        public void write(byte[] buffer,
                 int off,
                 int nbytes)
                   throws IOException
        Write up to nbytes of data from the given buffer, starting at offset off, to the underlying stream in GZIP format.
        Overrides:
        write in class DeflaterOutputStream
        Parameters:
        buffer - the buffer to write.
        off - the index of the first byte in buffer to write.
        nbytes - the number of bytes in buffer to write.
        Throws:
        IOException - If an error occurs during writing.


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: 139 / 158750571. Delta: 0.03640 с