/** * Returns the compression handler that can be used for one compression methods offered by the server. * * @return a instance of XMPPInputOutputStream or null if no suitable instance was found * */ private XMPPInputOutputStream maybeGetCompressionHandler() { Compress.Feature compression = getFeature(Compress.Feature.ELEMENT, Compress.NAMESPACE); if (compression == null) { // Server does not support compression return null; } for (XMPPInputOutputStream handler : SmackConfiguration.getCompresionHandlers()) { String method = handler.getCompressionMethod(); if (compression.getMethods().contains(method)) return handler; } return null; }
public static List<XMPPInputOutputStream> getCompresionHandlers() { List<XMPPInputOutputStream> res = new ArrayList<XMPPInputOutputStream>(compressionHandlers.size()); for (XMPPInputOutputStream ios : compressionHandlers) { if (ios.isSupported()) { res.add(ios); } } return res; }
/** * Returns the compression handler that can be used for one compression methods offered by the server. * * @return a instance of XMPPInputOutputStream or null if no suitable instance was found * */ private XMPPInputOutputStream maybeGetCompressionHandler() { if (compressionMethods != null) { for (XMPPInputOutputStream handler : compressionHandlers) { if (!handler.isSupported()) continue; String method = handler.getCompressionMethod(); if (compressionMethods.contains(method)) return handler; } } return null; }
/** * Returns the compression handler that can be used for one compression methods offered by the server. * * @return a instance of XMPPInputOutputStream or null if no suitable instance was found * */ private static XMPPInputOutputStream maybeGetCompressionHandler(Compress.Feature compression) { for (XMPPInputOutputStream handler : SmackConfiguration.getCompresionHandlers()) { String method = handler.getCompressionMethod(); if (compression.getMethods().contains(method)) return handler; } return null; }
/** * Returns the compression handler that can be used for one compression * methods offered by the server. * * @return a instance of XMPPInputOutputStream or null if no suitable * instance was found * */ private XMPPInputOutputStream maybeGetCompressionHandler() { if (compressionMethods != null) { for (XMPPInputOutputStream handler : compressionHandlers) { if (!handler.isSupported()) continue; String method = handler.getCompressionMethod(); if (compressionMethods.contains(method)) return handler; } } return null; }
private void setSyncFlush() { if (mSharedPreferences.getBoolean(XMPP_STREAM_COMPRESSION_SYNC_FLUSH, false)) { XMPPInputOutputStream.setFlushMethod(FlushMethod.SYNC_FLUSH); } else { XMPPInputOutputStream.setFlushMethod(FlushMethod.FULL_FLUSH); } }
public static void addCompressionHandler(XMPPInputOutputStream xmppInputOutputStream) { compressionHandlers.add(xmppInputOutputStream); }
/** * Returns the compression handler that can be used for one compression methods offered by the server. * * @return a instance of XMPPInputOutputStream or null if no suitable instance was found * */ private XMPPInputOutputStream maybeGetCompressionHandler() { return null; }