1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-17 21:32:26 -05:00

Use java.util.zip for inflating

Can't use it for deflating since it doesn't have Z_PARTIAL_FLUSH
This commit is contained in:
Matt Johnston 2011-02-12 17:01:05 +08:00 committed by cketti
parent eb9fca69c6
commit d43f17ab94

View File

@ -89,8 +89,9 @@ import com.fsck.k9.mail.store.ImapResponseParser.ImapList;
import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse; import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse;
import com.fsck.k9.mail.transport.imap.ImapSettings; import com.fsck.k9.mail.transport.imap.ImapSettings;
import com.jcraft.jzlib.JZlib; import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZInputStream;
import com.jcraft.jzlib.ZOutputStream; import com.jcraft.jzlib.ZOutputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
/** /**
* <pre> * <pre>
@ -1986,8 +1987,8 @@ public class ImapStore extends Store {
if (useCompression) { if (useCompression) {
try { try {
executeSimpleCommand(COMMAND_COMPRESS_DEFLATE); executeSimpleCommand(COMMAND_COMPRESS_DEFLATE);
ZInputStream zInputStream = new ZInputStream(mSocket.getInputStream(), true); Inflater inf = new Inflater(true);
zInputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH); InflaterInputStream zInputStream = new InflaterInputStream(mSocket.getInputStream(), inf);
mIn = new PeekableInputStream(new BufferedInputStream(zInputStream, 1024)); mIn = new PeekableInputStream(new BufferedInputStream(zInputStream, 1024));
mParser = new ImapResponseParser(mIn); mParser = new ImapResponseParser(mIn);
ZOutputStream zOutputStream = new ZOutputStream(mSocket.getOutputStream(), JZlib.Z_BEST_SPEED, true); ZOutputStream zOutputStream = new ZOutputStream(mSocket.getOutputStream(), JZlib.Z_BEST_SPEED, true);