|
|||||||||
| 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
com.mucommander.file.impl.zip.provider.DeflatedOutputStream
public class DeflatedOutputStream
DeflatedOutputStream compresses data using the DEFLATED compression method.
--------------------------------------------------------------------------------------------------------------
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 byte[] |
buf
Buffer used to deflate data |
protected java.util.zip.Deflater |
deflater
Deflater instance that does the actual compression work |
| Fields inherited from class com.mucommander.file.impl.zip.provider.ZipEntryOutputStream |
|---|
crc, method, out |
| Constructor Summary | |
|---|---|
DeflatedOutputStream(java.io.OutputStream out,
java.util.zip.Deflater deflater,
byte[] buf)
Creates a new DeflatedOutputStream that writes compressed data to the given OutputStream
and automatically updates the supplied CRC32 checksum. |
|
| Method Summary | |
|---|---|
void |
close()
Completes writing the entry without closing the underlying OutputStream. |
protected void |
deflate()
Writes next block of compressed data to the output stream. |
void |
finishDeflate()
Finishes writing the DEFLATED-compressed data. |
int |
getTotalIn()
Returns the uncompressed size of the data written so far. |
int |
getTotalOut()
Returns the compressed size of the data written so far. |
void |
write(byte[] b,
int offset,
int length)
Writes the given bytes to the Zip entry. |
| Methods inherited from class com.mucommander.file.impl.zip.provider.ZipEntryOutputStream |
|---|
flush, getCrc, getMethod, write |
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.zip.Deflater deflater
protected byte[] buf
| Constructor Detail |
|---|
public DeflatedOutputStream(java.io.OutputStream out,
java.util.zip.Deflater deflater,
byte[] buf)
DeflatedOutputStream that writes compressed data to the given OutputStream
and automatically updates the supplied CRC32 checksum.
out - the OutputStream where the compressed data is sent todeflater - the Deflater that compresses data, reset before first usebuf - the buffer used to deflate data| Method Detail |
|---|
protected void deflate()
throws java.io.IOException
java.io.IOException - on error
public void finishDeflate()
throws java.io.IOException
java.io.IOException - if an I/O occurredpublic int getTotalIn()
ZipEntryOutputStream
getTotalIn in class ZipEntryOutputStreampublic int getTotalOut()
ZipEntryOutputStream
getTotalOut in class ZipEntryOutputStream
public void write(byte[] b,
int offset,
int length)
throws java.io.IOException
write in class java.io.OutputStreamb - the byte array to writeoffset - the start position to write fromlength - the number of bytes to write
java.io.IOException - on error
public void close()
throws java.io.IOException
OutputStream.
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException
|
|||||||||
| 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