From d43f17ab949c7ea3c8fd2eb1d13aa57e7ceb8b95 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sat, 12 Feb 2011 17:01:05 +0800 Subject: [PATCH] Use java.util.zip for inflating Can't use it for deflating since it doesn't have Z_PARTIAL_FLUSH --- src/com/fsck/k9/mail/store/ImapStore.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index f122cfab5..1e592312c 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -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.transport.imap.ImapSettings; import com.jcraft.jzlib.JZlib; -import com.jcraft.jzlib.ZInputStream; import com.jcraft.jzlib.ZOutputStream; +import java.util.zip.Inflater; +import java.util.zip.InflaterInputStream; /** *
@@ -1986,8 +1987,8 @@ public class ImapStore extends Store {
                     if (useCompression) {
                         try {
                             executeSimpleCommand(COMMAND_COMPRESS_DEFLATE);
-                            ZInputStream zInputStream = new ZInputStream(mSocket.getInputStream(), true);
-                            zInputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
+                            Inflater inf = new Inflater(true);
+                            InflaterInputStream zInputStream = new InflaterInputStream(mSocket.getInputStream(), inf);
                             mIn = new PeekableInputStream(new BufferedInputStream(zInputStream, 1024));
                             mParser = new ImapResponseParser(mIn);
                             ZOutputStream zOutputStream = new ZOutputStream(mSocket.getOutputStream(), JZlib.Z_BEST_SPEED, true);