aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-01-03 23:19:05 +0100
committerlookshe <github@lookshe.org>2015-01-03 23:19:05 +0100
commit95e2a539517c27b3235acd582f17968c8e301e81 (patch)
tree213bbeed798751e949376d85f4d7d0bd30c5fbfa /src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java
parent48717dd7d37c066ab626fc626a2ced626ef21d42 (diff)
parent4f4eff2353f4e359b5582c8e808a4e88631c3e74 (diff)
Merge branch 'master' of ssh://git.fucktheforce.de/conversations
Conflicts: src/main/java/eu/siacs/conversations/Config.java src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java src/main/java/eu/siacs/conversations/utils/UIHelper.java
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java b/src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java
deleted file mode 100644
index b777c10c..00000000
--- a/src/main/java/eu/siacs/conversations/utils/zlib/ZLibInputStream.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package eu.siacs.conversations.utils.zlib;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.Inflater;
-import java.util.zip.InflaterInputStream;
-
-/**
- * ZLibInputStream is a zlib and input stream compatible version of an
- * InflaterInputStream. This class solves the incompatibility between
- * {@link InputStream#available()} and {@link InflaterInputStream#available()}.
- */
-public class ZLibInputStream extends InflaterInputStream {
-
- /**
- * Construct a ZLibInputStream, reading data from the underlying stream.
- *
- * @param is
- * The {@code InputStream} to read data from.
- * @throws IOException
- * If an {@code IOException} occurs.
- */
- public ZLibInputStream(InputStream is) throws IOException {
- super(is, new Inflater(), 512);
- }
-
- /**
- * Provide a more InputStream compatible version of available. A return
- * value of 1 means that it is likly to read one byte without blocking, 0
- * means that the system is known to block for more input.
- *
- * @return 0 if no data is available, 1 otherwise
- * @throws IOException
- */
- @Override
- public int available() throws IOException {
- /*
- * This is one of the funny code blocks. InflaterInputStream.available
- * violates the contract of InputStream.available, which breaks kXML2.
- *
- * I'm not sure who's to blame, oracle/sun for a broken api or the
- * google guys for mixing a sun bug with a xml reader that can't handle
- * it....
- *
- * Anyway, this simple if breaks suns distorted reality, but helps to
- * use the api as intended.
- */
- if (inf.needsInput()) {
- return 0;
- }
- return super.available();
- }
-
-}