org.jgroups.util.Util.writeStreamable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.jgroups.util.Util.writeStreamable()方法的一些代码示例,展示了Util.writeStreamable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.writeStreamable()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:writeStreamable

Util.writeStreamable介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeStreamable(digest, out);
  Util.writeStreamable(bind_addr, out);
}

代码示例来源:origin: wildfly/wildfly

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeStreamable(my_digest, out);
}

代码示例来源:origin: wildfly/wildfly

@Override
public void writeTo(DataOutput out) throws Exception {
  Util.writeStreamable(new ByteBufferStreamable(bytes1), out);
  Util.writeStreamable(new ByteBufferStreamable(bytes2), out);
}

代码示例来源:origin: wildfly/wildfly

@Override
public void writeTo(DataOutput out) throws Exception {
  Util.writeStreamable(new ByteBufferStreamable(buffer), out);
}

代码示例来源:origin: wildfly/wildfly

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type.ordinal());
  Bits.writeString(lock_name,out);
  out.writeInt(lock_id);
  Util.writeStreamable(owner, out);
  out.writeLong(timeout);
  out.writeBoolean(is_trylock);
  Util.writeStreamable(info_rsp, out);
  Util.writeAddress(sender, out);
}

代码示例来源:origin: wildfly/wildfly

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeAddress(mbr, out);
  Util.writeStreamable(sock_addr, out);
  int size=mbrs != null? mbrs.size() : 0;
  out.writeInt(size);
  if(size > 0)
    for(Address address: mbrs)
      Util.writeAddress(address, out);
}

代码示例来源:origin: wildfly/wildfly

public void writeTo(DataOutput out) throws Exception {
  Bits.writeLong(num_gets, out);
  Bits.writeLong(num_puts, out);
  Bits.writeLong(time, out);
  Util.writeStreamable(avg_gets, out);
  Util.writeStreamable(avg_puts, out);
}

代码示例来源:origin: wildfly/wildfly

public static Buffer streamableToBuffer(Streamable obj) {
  int expected_size=obj instanceof SizeStreamable? ((SizeStreamable)obj).serializedSize() +1 : 512;
  final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(expected_size);
  try {
    Util.writeStreamable(obj,out);
    return out.getBuffer();
  }
  catch(Exception ex) {
    return null;
  }
}

代码示例来源:origin: wildfly/wildfly

protected static Buffer marshal(final Collection<? extends Address> participants, final Digest digest) {
  final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512);
  try {
    Util.writeAddresses(participants, out);
    Util.writeStreamable(digest,out);
    return out.getBuffer();
  }
  catch(Exception ex) {
    return null;
  }
}

代码示例来源:origin: wildfly/wildfly

public static Buffer marshal(LazyRemovalCache<Address,IpAddress> addrs) {
  final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512);
  try {
    int size=addrs != null? addrs.size() : 0;
    out.writeInt(size);
    if(size > 0) {
      for(Map.Entry<Address,LazyRemovalCache.Entry<IpAddress>> entry: addrs.entrySet()) {
        Address key=entry.getKey();
        IpAddress val=entry.getValue().getVal();
        Util.writeAddress(key, out);
        Util.writeStreamable(val, out);
      }
    }
    return out.getBuffer();
  }
  catch(Exception ex) {
    return null;
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeStreamable(digest, out);
  Util.writeStreamable(bind_addr, out);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeStreamable(my_digest, out);
}

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

public void writeTo(DataOutputStream out) throws IOException {
  out.writeByte(type);
  boolean isMergeView=view != null && view instanceof MergeView;
  out.writeBoolean(isMergeView);
  Util.writeStreamable(view, out);
  Util.writeAddress(mbr, out);
  Util.writeStreamable(join_rsp, out);
  Util.writeStreamable(my_digest, out);
  Util.writeStreamable(merge_id, out); // kludge: we know merge_id is a ViewId
  out.writeBoolean(merge_rejected);
}

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

public void writeTo(DataOutputStream out) throws IOException {
  Util.writeStreamable(view, out);
  Util.writeStreamable(digest, out);
  Util.writeString(fail_reason, out);
}

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

public void writeTo(DataOutputStream out) throws IOException {
  out.writeInt(type);
  // 0 == null, 1 == View, 2 == MergeView
  byte b=(byte)(view == null? 0 : (view instanceof MergeView? 2 : 1));
  out.writeByte(b);
  Util.writeStreamable(view, out);
}

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

public void writeTo(DataOutputStream out) throws IOException {
  out.writeByte(type);
  out.writeLong(id);
  Util.writeAddress(sender, out);
  Util.writeStreamable(my_digest, out);
  Util.writeStreamable(bind_addr, out);
  Util.writeString(state_id, out);
}

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

public void writeTo(DataOutputStream out) throws IOException {
  out.writeByte(type);
  if(type != XMIT_RSP)
    out.writeLong(seqno);
  Util.writeStreamable(range, out);
  Util.writeAddress(sender, out);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public void writeTo(DataOutput out) throws Exception {
  Util.writeStreamable(new ByteBufferStreamable(bytes1), out);
  Util.writeStreamable(new ByteBufferStreamable(bytes2), out);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type.ordinal());
  Bits.writeString(lock_name,out);
  out.writeInt(lock_id);
  Util.writeStreamable(owner, out);
  out.writeLong(timeout);
  out.writeBoolean(is_trylock);
  Util.writeStreamable(info_rsp, out);
  Util.writeAddress(sender, out);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void writeTo(DataOutput out) throws Exception {
  out.writeByte(type);
  Util.writeAddress(mbr, out);
  Util.writeStreamable(sock_addr, out);
  int size=mbrs != null? mbrs.size() : 0;
  out.writeInt(size);
  if(size > 0)
    for(Address address: mbrs)
      Util.writeAddress(address, out);
}

相关文章

Util类方法