CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 Open.java 源代码,内容仅作参考
package org.jivesoftware.smackx.bytestreams.ibb.packet;
import java.util.Locale;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager;
public class Open extends IQ {
public static final String ELEMENT = "open";
public static final String NAMESPACE = "http://jabber.org/protocol/ibb";
private final int blockSize;
private final String sessionID;
private final InBandBytestreamManager.StanzaType stanza;
public Open(String str, int i, InBandBytestreamManager.StanzaType stanzaType) {
super("open", "http://jabber.org/protocol/ibb");
if (str == null || "".equals(str)) {
throw new IllegalArgumentException("Session ID must not be null or empty");
}
if (i > 0) {
this.sessionID = str;
this.blockSize = i;
this.stanza = stanzaType;
setType(IQ.Type.set);
return;
}
throw new IllegalArgumentException("Block size must be greater than zero");
}
public int getBlockSize() {
return this.blockSize;
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.attribute("block-size", Integer.toString(this.blockSize));
iQChildElementXmlStringBuilder.attribute("sid", this.sessionID);
iQChildElementXmlStringBuilder.attribute("stanza", this.stanza.toString().toLowerCase(Locale.US));
iQChildElementXmlStringBuilder.setEmptyElement();
return iQChildElementXmlStringBuilder;
}
public String getSessionID() {
return this.sessionID;
}
public InBandBytestreamManager.StanzaType getStanza() {
return this.stanza;
}
public Open(String str, int i) {
this(str, i, InBandBytestreamManager.StanzaType.IQ);
}
}