|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.mucommander.file.impl.zip.provider.ZipEntryOutputStream
public abstract class ZipEntryOutputStream
ZipEntryOutputStream is an abstract OutputStream used for compressing a Zip entry's data to an
underlying OutputStream.
The CRC32 checksum is calculated on-the-fly as data gets written to the stream, getCrc() returns the
current checksum value. The getTotalIn() and getTotalOut() methods keep track of the uncompressed
and compressed of the supplied data.
There currently are two implementations of this class:
DeflatedOutputStream: implements the DEFLATED compression method
StoredOutputStream: implements the STORED compression method
(i.e. no compression)--------------------------------------------------------------------------------------------------------------
This class is based off the org.apache.tools.zip package of the Apache Ant project. The Ant
code has been modified under the terms of the Apache License which you can find in the bundled muCommander license
file. It was forked at version 1.7.0 of Ant.
| Field Summary | |
|---|---|
protected java.util.zip.CRC32 |
crc
The CRC32 instance that calculates the checksum |
protected int |
method
Compression method (DEFLATED or STORED) |
protected java.io.OutputStream |
out
The underlying stream where the compressed data is sent |
| Constructor Summary | |
|---|---|
ZipEntryOutputStream(java.io.OutputStream out,
int method)
Creates a new EntryOutputStream that writes compressed data to the given OutputStream
and automatically updates the supplied CRC32 checksum. |
|
| Method Summary | |
|---|---|
void |
flush()
Flushes the underlying OutputStream. |
long |
getCrc()
Returns the CRC value of the data written so far. |
int |
getMethod()
Returns the compression method used for writing the supplied data. |
abstract int |
getTotalIn()
Returns the uncompressed size of the data written so far. |
abstract int |
getTotalOut()
Returns the compressed size of the data written so far. |
void |
write(int b)
|
| Methods inherited from class java.io.OutputStream |
|---|
close, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.OutputStream out
protected int method
protected java.util.zip.CRC32 crc
| Constructor Detail |
|---|
public ZipEntryOutputStream(java.io.OutputStream out,
int method)
EntryOutputStream that writes compressed data to the given OutputStream
and automatically updates the supplied CRC32 checksum.
out - the OutputStream where the compressed data is sent tomethod - the compression method, ZipConstants.DEFLATED or ZipConstants.STORED| Method Detail |
|---|
public int getMethod()
public long getCrc()
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void flush()
throws java.io.IOException
OutputStream.
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic abstract int getTotalIn()
public abstract int getTotalOut()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard