本文整理了Java中org.jgroups.util.Util.readStreamable()
方法的一些代码示例,展示了Util.readStreamable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.readStreamable()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:readStreamable
暂无
代码示例来源:origin: wildfly/wildfly
@Override
public void readFrom(DataInput in) throws Exception {
bytes1 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
bytes2 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
}
}
代码示例来源:origin: wildfly/wildfly
@Override
public void readFrom(DataInput in) throws Exception {
buffer = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
}
}
代码示例来源:origin: wildfly/wildfly
public void readFrom(DataInput in) throws Exception {
type=in.readByte();
digest=Util.readStreamable(Digest::new, in);
bind_addr=Util.readStreamable(IpAddress::new, in);
}
代码示例来源:origin: wildfly/wildfly
public void readFrom(DataInput in) throws Exception {
type=in.readByte();
my_digest=Util.readStreamable(Digest::new, in);
}
代码示例来源:origin: wildfly/wildfly
@Deprecated
public static <T extends Streamable> T streamableFromBuffer(Class<T> clazz,byte[] buffer,int offset,int length) throws Exception {
DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
return Util.readStreamable(clazz, in);
}
代码示例来源:origin: wildfly/wildfly
public static <T extends Streamable> T streamableFromBuffer(Supplier<T> factory, byte[] buffer, int offset, int length) throws Exception {
DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
return Util.readStreamable(factory, in);
}
代码示例来源:origin: wildfly/wildfly
public void readFrom(DataInput in) throws Exception {
type=Type.values()[in.readByte()];
lock_name=Bits.readString(in);
lock_id=in.readInt();
owner=Util.readStreamable(Owner::new, in);
timeout=in.readLong();
is_trylock=in.readBoolean();
info_rsp=Util.readStreamable(LockInfoResponse::new, in);
sender=Util.readAddress(in);
}
代码示例来源:origin: wildfly/wildfly
public void readFrom(DataInput in) throws Exception {
type=in.readByte();
mbr=Util.readAddress(in);
sock_addr=Util.readStreamable(IpAddress::new, in);
int size=in.readInt();
if(size > 0) {
mbrs=new HashSet<>();
for(int i=0; i < size; i++)
mbrs.add(Util.readAddress(in));
}
}
代码示例来源:origin: wildfly/wildfly
public void readFrom(DataInput in) throws Exception {
num_gets=Bits.readLong(in);
num_puts=Bits.readLong(in);
time=Bits.readLong(in);
avg_gets=Util.readStreamable(AverageMinMax::new, in);
avg_puts=Util.readStreamable(AverageMinMax::new, in);
}
代码示例来源:origin: wildfly/wildfly
protected Map<Address,IpAddress> unmarshal(byte[] buffer, int offset, int length) {
if(buffer == null) return null;
DataInput in=new ByteArrayDataInputStream(buffer, offset, length);
HashMap<Address,IpAddress> addrs=null;
try {
int size=in.readInt();
if(size > 0) {
addrs=new HashMap<>(size);
for(int i=0; i < size; i++) {
Address key=Util.readAddress(in);
IpAddress val=Util.readStreamable(IpAddress::new, in);
addrs.put(key, val);
}
}
return addrs;
}
catch(Exception ex) {
log.error("%s: failed reading addresses from message: %s", local_addr, ex);
return null;
}
}
代码示例来源:origin: wildfly/wildfly
protected Tuple<Collection<? extends Address>,Digest> readParticipantsAndDigest(byte[] buffer, int offset, int length) {
if(buffer == null) return null;
try {
DataInput in=new ByteArrayDataInputStream(buffer, offset, length);
Collection<Address> participants=Util.readAddresses(in, ArrayList::new);
Digest digest=Util.readStreamable(Digest::new, in);
return new Tuple<>(participants, digest);
}
catch(Exception ex) {
log.error("%s: failed reading particpants and digest from message: %s", localAddress, ex);
return null;
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public void readFrom(DataInput in) throws Exception {
buffer = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public void readFrom(DataInput in) throws Exception {
bytes1 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
bytes2 = Util.readStreamable(ByteBufferStreamable::new, in).buffer;
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public void readFrom(DataInput in) throws Exception {
type=in.readByte();
digest=Util.readStreamable(Digest::new, in);
bind_addr=Util.readStreamable(IpAddress::new, in);
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, InstantiationException {
type=instream.readByte();
arg=(PingRsp)Util.readStreamable(PingRsp.class, instream);
}
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
view=(View)Util.readStreamable(View.class, in);
digest=(Digest)Util.readStreamable(Digest.class, in);
fail_reason=Util.readString(in);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public static <T extends Streamable> T streamableFromBuffer(Supplier<T> factory, byte[] buffer, int offset, int length) throws Exception {
DataInput in=new ByteArrayDataInputStream(buffer,offset,length);
return Util.readStreamable(factory, in);
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
if(type != XMIT_RSP)
seqno=in.readLong();
range=(Range)Util.readStreamable(Range.class, in);
sender=Util.readAddress(in);
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
InstantiationException {
type = in.readByte();
id = in.readLong();
sender = Util.readAddress(in);
my_digest = (Digest) Util.readStreamable(Digest.class, in);
bind_addr = (IpAddress) Util.readStreamable(IpAddress.class, in);
state_id = Util.readString(in);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public void readFrom(DataInput in) throws Exception {
type=Type.values()[in.readByte()];
lock_name=Bits.readString(in);
lock_id=in.readInt();
owner=Util.readStreamable(Owner::new, in);
timeout=in.readLong();
is_trylock=in.readBoolean();
info_rsp=Util.readStreamable(LockInfoResponse::new, in);
sender=Util.readAddress(in);
}
内容来源于网络,如有侵权,请联系作者删除!