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

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

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

Util.readStreamable介绍

暂无

代码示例

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

  1. @Override
  2. public void readFrom(DataInput in) throws Exception {
  3. bytes1 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  4. bytes2 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  5. }
  6. }

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

  1. @Override
  2. public void readFrom(DataInput in) throws Exception {
  3. buffer = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  4. }
  5. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=in.readByte();
  3. digest=Util.readStreamable(Digest::new, in);
  4. bind_addr=Util.readStreamable(IpAddress::new, in);
  5. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=in.readByte();
  3. my_digest=Util.readStreamable(Digest::new, in);
  4. }

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

  1. @Deprecated
  2. public static <T extends Streamable> T streamableFromBuffer(Class<T> clazz,byte[] buffer,int offset,int length) throws Exception {
  3. DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
  4. return Util.readStreamable(clazz, in);
  5. }

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

  1. public static <T extends Streamable> T streamableFromBuffer(Supplier<T> factory, byte[] buffer, int offset, int length) throws Exception {
  2. DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
  3. return Util.readStreamable(factory, in);
  4. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=Type.values()[in.readByte()];
  3. lock_name=Bits.readString(in);
  4. lock_id=in.readInt();
  5. owner=Util.readStreamable(Owner::new, in);
  6. timeout=in.readLong();
  7. is_trylock=in.readBoolean();
  8. info_rsp=Util.readStreamable(LockInfoResponse::new, in);
  9. sender=Util.readAddress(in);
  10. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=in.readByte();
  3. mbr=Util.readAddress(in);
  4. sock_addr=Util.readStreamable(IpAddress::new, in);
  5. int size=in.readInt();
  6. if(size > 0) {
  7. mbrs=new HashSet<>();
  8. for(int i=0; i < size; i++)
  9. mbrs.add(Util.readAddress(in));
  10. }
  11. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. num_gets=Bits.readLong(in);
  3. num_puts=Bits.readLong(in);
  4. time=Bits.readLong(in);
  5. avg_gets=Util.readStreamable(AverageMinMax::new, in);
  6. avg_puts=Util.readStreamable(AverageMinMax::new, in);
  7. }

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

  1. protected Map<Address,IpAddress> unmarshal(byte[] buffer, int offset, int length) {
  2. if(buffer == null) return null;
  3. DataInput in=new ByteArrayDataInputStream(buffer, offset, length);
  4. HashMap<Address,IpAddress> addrs=null;
  5. try {
  6. int size=in.readInt();
  7. if(size > 0) {
  8. addrs=new HashMap<>(size);
  9. for(int i=0; i < size; i++) {
  10. Address key=Util.readAddress(in);
  11. IpAddress val=Util.readStreamable(IpAddress::new, in);
  12. addrs.put(key, val);
  13. }
  14. }
  15. return addrs;
  16. }
  17. catch(Exception ex) {
  18. log.error("%s: failed reading addresses from message: %s", local_addr, ex);
  19. return null;
  20. }
  21. }

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

  1. protected Tuple<Collection<? extends Address>,Digest> readParticipantsAndDigest(byte[] buffer, int offset, int length) {
  2. if(buffer == null) return null;
  3. try {
  4. DataInput in=new ByteArrayDataInputStream(buffer, offset, length);
  5. Collection<Address> participants=Util.readAddresses(in, ArrayList::new);
  6. Digest digest=Util.readStreamable(Digest::new, in);
  7. return new Tuple<>(participants, digest);
  8. }
  9. catch(Exception ex) {
  10. log.error("%s: failed reading particpants and digest from message: %s", localAddress, ex);
  11. return null;
  12. }
  13. }

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

  1. @Override
  2. public void readFrom(DataInput in) throws Exception {
  3. buffer = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  4. }
  5. }

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

  1. @Override
  2. public void readFrom(DataInput in) throws Exception {
  3. bytes1 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  4. bytes2 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
  5. }
  6. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=in.readByte();
  3. digest=Util.readStreamable(Digest::new, in);
  4. bind_addr=Util.readStreamable(IpAddress::new, in);
  5. }

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

  1. public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, InstantiationException {
  2. type=instream.readByte();
  3. arg=(PingRsp)Util.readStreamable(PingRsp.class, instream);
  4. }
  5. }

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

  1. public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
  2. view=(View)Util.readStreamable(View.class, in);
  3. digest=(Digest)Util.readStreamable(Digest.class, in);
  4. fail_reason=Util.readString(in);
  5. }

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

  1. public static <T extends Streamable> T streamableFromBuffer(Supplier<T> factory, byte[] buffer, int offset, int length) throws Exception {
  2. DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
  3. return Util.readStreamable(factory, in);
  4. }

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

  1. public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
  2. type=in.readByte();
  3. if(type != XMIT_RSP)
  4. seqno=in.readLong();
  5. range=(Range)Util.readStreamable(Range.class, in);
  6. sender=Util.readAddress(in);
  7. }

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

  1. public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
  2. InstantiationException {
  3. type = in.readByte();
  4. id = in.readLong();
  5. sender = Util.readAddress(in);
  6. my_digest = (Digest) Util.readStreamable(Digest.class, in);
  7. bind_addr = (IpAddress) Util.readStreamable(IpAddress.class, in);
  8. state_id = Util.readString(in);
  9. }

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

  1. public void readFrom(DataInput in) throws Exception {
  2. type=Type.values()[in.readByte()];
  3. lock_name=Bits.readString(in);
  4. lock_id=in.readInt();
  5. owner=Util.readStreamable(Owner::new, in);
  6. timeout=in.readLong();
  7. is_trylock=in.readBoolean();
  8. info_rsp=Util.readStreamable(LockInfoResponse::new, in);
  9. sender=Util.readAddress(in);
  10. }

相关文章

Util类方法