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

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

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

Util.writeStreamable介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeByte(type.ordinal());
  3. Bits.writeString(lock_name,out);
  4. out.writeInt(lock_id);
  5. Util.writeStreamable(owner, out);
  6. out.writeLong(timeout);
  7. out.writeBoolean(is_trylock);
  8. Util.writeStreamable(info_rsp, out);
  9. Util.writeAddress(sender, out);
  10. }

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeByte(type);
  3. Util.writeAddress(mbr, out);
  4. Util.writeStreamable(sock_addr, out);
  5. int size=mbrs != null? mbrs.size() : 0;
  6. out.writeInt(size);
  7. if(size > 0)
  8. for(Address address: mbrs)
  9. Util.writeAddress(address, out);
  10. }

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. Bits.writeLong(num_gets, out);
  3. Bits.writeLong(num_puts, out);
  4. Bits.writeLong(time, out);
  5. Util.writeStreamable(avg_gets, out);
  6. Util.writeStreamable(avg_puts, out);
  7. }

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

  1. public static Buffer streamableToBuffer(Streamable obj) {
  2. int expected_size=obj instanceof SizeStreamable? ((SizeStreamable)obj).serializedSize() +1 : 512;
  3. final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(expected_size);
  4. try {
  5. Util.writeStreamable(obj,out);
  6. return out.getBuffer();
  7. }
  8. catch(Exception ex) {
  9. return null;
  10. }
  11. }

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

  1. protected static Buffer marshal(final Collection<? extends Address> participants, final Digest digest) {
  2. final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512);
  3. try {
  4. Util.writeAddresses(participants, out);
  5. Util.writeStreamable(digest,out);
  6. return out.getBuffer();
  7. }
  8. catch(Exception ex) {
  9. return null;
  10. }
  11. }

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

  1. public static Buffer marshal(LazyRemovalCache<Address,IpAddress> addrs) {
  2. final ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(512);
  3. try {
  4. int size=addrs != null? addrs.size() : 0;
  5. out.writeInt(size);
  6. if(size > 0) {
  7. for(Map.Entry<Address,LazyRemovalCache.Entry<IpAddress>> entry: addrs.entrySet()) {
  8. Address key=entry.getKey();
  9. IpAddress val=entry.getValue().getVal();
  10. Util.writeAddress(key, out);
  11. Util.writeStreamable(val, out);
  12. }
  13. }
  14. return out.getBuffer();
  15. }
  16. catch(Exception ex) {
  17. return null;
  18. }
  19. }

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

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

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

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

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

  1. public void writeTo(DataOutputStream out) throws IOException {
  2. out.writeByte(type);
  3. boolean isMergeView=view != null && view instanceof MergeView;
  4. out.writeBoolean(isMergeView);
  5. Util.writeStreamable(view, out);
  6. Util.writeAddress(mbr, out);
  7. Util.writeStreamable(join_rsp, out);
  8. Util.writeStreamable(my_digest, out);
  9. Util.writeStreamable(merge_id, out); // kludge: we know merge_id is a ViewId
  10. out.writeBoolean(merge_rejected);
  11. }

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

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

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

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

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

  1. public void writeTo(DataOutputStream out) throws IOException {
  2. out.writeByte(type);
  3. out.writeLong(id);
  4. Util.writeAddress(sender, out);
  5. Util.writeStreamable(my_digest, out);
  6. Util.writeStreamable(bind_addr, out);
  7. Util.writeString(state_id, out);
  8. }

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

  1. public void writeTo(DataOutputStream out) throws IOException {
  2. out.writeByte(type);
  3. if(type != XMIT_RSP)
  4. out.writeLong(seqno);
  5. Util.writeStreamable(range, out);
  6. Util.writeAddress(sender, out);
  7. }

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

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

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeByte(type.ordinal());
  3. Bits.writeString(lock_name,out);
  4. out.writeInt(lock_id);
  5. Util.writeStreamable(owner, out);
  6. out.writeLong(timeout);
  7. out.writeBoolean(is_trylock);
  8. Util.writeStreamable(info_rsp, out);
  9. Util.writeAddress(sender, out);
  10. }

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeByte(type);
  3. Util.writeAddress(mbr, out);
  4. Util.writeStreamable(sock_addr, out);
  5. int size=mbrs != null? mbrs.size() : 0;
  6. out.writeInt(size);
  7. if(size > 0)
  8. for(Address address: mbrs)
  9. Util.writeAddress(address, out);
  10. }

相关文章

Util类方法