本文整理了Java中org.jgroups.util.Util.size()
方法的一些代码示例,展示了Util.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.size()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:size
[英]Returns the marshalled size of a Collection of Addresses. Assumes elements are of the same type !
[中]
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
if (destinations == null) {
return Global.INT_SIZE;
}
int size = Global.INT_SIZE;
for (Address address : destinations) {
size += Util.size(address);
}
return size;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE; // type
retval+=Util.size(mbrs);
retval+=Util.size(from);
return retval;
}
代码示例来源:origin: wildfly/wildfly
public static long size(Address[] addrs) {
int retval=Global.SHORT_SIZE; // number of elements
if(addrs != null)
for(Address addr : addrs)
retval+=Util.size(addr);
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE; // type
switch(type) {
case CHALLENGE:
retval+=Util.size(payload);
break;
case RESPONSE:
retval+=Global.LONG_SIZE;
break;
}
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
return Global.SHORT_SIZE + Util.size(addr) + Util.size(name);
}
}
代码示例来源:origin: wildfly/wildfly
@Override
public int size() {
return Util.size(this.sharedSecret);
}
代码示例来源:origin: wildfly/wildfly
public int size() {
return Util.size(token);
}
}
代码示例来源:origin: wildfly/wildfly
@Override
public int serializedSize() {
return Util.size(payload);
}
代码示例来源:origin: wildfly/wildfly
public int size() {
return Util.size(auth_value);
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE; // for is_server
retval+=Util.size(sender);
retval+=Global.BYTE_SIZE; // presence byte for logical_name
if(logical_name != null)
retval+=logical_name.length() +2;
retval+=Util.size(physical_addr);
retval+=Util.size(mbrs);
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE; // for the type
retval+=Util.size(view_id);
retval+=Global.BYTE_SIZE; // presence byte for logical_name
if(logical_name != null)
retval+=logical_name.length() +2;
retval+=Util.size(physical_addr);
return retval;
}
代码示例来源:origin: wildfly/wildfly
/**
* Returns the marshalled size of a Collection of Addresses.
* <em>Assumes elements are of the same type !</em>
* @param addrs Collection<Address>
* @return long size
*/
public static long size(Collection<? extends Address> addrs) {
int retval=Global.SHORT_SIZE; // number of elements
if(addrs != null && !addrs.isEmpty()) {
Address addr=addrs.iterator().next();
retval+=size(addr) * addrs.size();
}
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE; // type
retval+=Global.BYTE_SIZE; // presence byte for my_digest
if(digest != null)
retval+=digest.serializedSize(true);
retval+=Util.size(bind_addr);
return retval;
}
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=Global.BYTE_SIZE // type
+ Global.SHORT_SIZE // flags
+ Util.size(mbr);
if(merge_id != null)
retval+=merge_id.size();
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
int retval=view_id.serializedSize() + ref_view_id.serializedSize();
retval+=Util.size(left_members);
retval+=Util.size(new_members);
return retval;
}
代码示例来源:origin: wildfly/wildfly
public long serializedSize(boolean with_members) {
long retval=with_members? Util.size(members) : Global.SHORT_SIZE;
for(int i=0; i < members.length; i++)
retval+=Bits.size(seqnos[i*2], seqnos[i*2+1]);
return retval;
}
代码示例来源:origin: wildfly/wildfly
public int serializedSize() {
return Bits.size(id) + Util.size(address);
}
代码示例来源:origin: wildfly/wildfly
protected static Buffer marshal(Collection<? extends Address> mbrs) {
try {
final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream((int)Util.size(mbrs));
Util.writeAddresses(mbrs, out);
return out.getBuffer();
}
catch(Exception ex) {
return null;
}
}
代码示例来源:origin: wildfly/wildfly
protected static Buffer marshal(final ViewId view_id) {
try {
final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(Util.size(view_id));
Util.writeViewId(view_id, out);
return out.getBuffer();
}
catch(Exception ex) {
return null;
}
}
代码示例来源:origin: wildfly/wildfly
public static byte[] collectionToByteBuffer(Collection<Address> c) throws Exception {
final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream((int)Util.size(c));
Util.writeAddresses(c,out);
return Arrays.copyOf(out.buffer(), out.position());
}
内容来源于网络,如有侵权,请联系作者删除!