Java 类org.jivesoftware.smack.compression.XMPPInputOutputStream 实例源码

项目:Smack    文件:XMPPTCPConnection.java   
/**
 * 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;
}
项目:Smack    文件:SmackConfiguration.java   
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;
}
项目:androidPN-client.    文件:XMPPConnection.java   
/**
 * 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;
}
项目:androidclient    文件:XMPPTCPConnection.java   
/**
 * 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;
}
项目:jamppa    文件:XMPPConnection.java   
/**
 * 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;
}
项目:maxs    文件:Settings.java   
private void setSyncFlush() {
    if (mSharedPreferences.getBoolean(XMPP_STREAM_COMPRESSION_SYNC_FLUSH, false)) {
        XMPPInputOutputStream.setFlushMethod(FlushMethod.SYNC_FLUSH);
    } else {
        XMPPInputOutputStream.setFlushMethod(FlushMethod.FULL_FLUSH);
    }
}
项目:java-bells    文件:XMPPConnection.java   
/**
 * 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;
}
项目:Smack    文件:SmackConfiguration.java   
public static void addCompressionHandler(XMPPInputOutputStream xmppInputOutputStream) {
    compressionHandlers.add(xmppInputOutputStream);
}
项目:asmack-mini    文件:XMPPConnection.java   
/**
 * 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;
}