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

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

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

Util.objectToStream介绍

暂无

代码示例

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

  1. public void objectToStream(Object obj, DataOutput out) throws Exception {
  2. Util.objectToStream(obj, out);
  3. }

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

  1. public void objectToStream(Object obj, DataOutput out) throws Exception {
  2. Util.objectToStream(obj, out);
  3. }

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

  1. public void objectToStream(Object obj, DataOutput out) throws Exception {
  2. Util.objectToStream(obj, out);
  3. }

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

  1. protected void writeTypes(DataOutput out) throws Exception {
  2. int types_len=types != null? types.length : 0;
  3. out.write(types_len);
  4. if(types_len > 0)
  5. for(Class<?> type: types)
  6. Util.objectToStream(type, out);
  7. }

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

  1. public void getState(OutputStream ostream) throws Exception {
  2. Util.objectToStream(stocks, new DataOutputStream(ostream));
  3. }

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

  1. protected void writeMethod(DataOutput out) throws Exception {
  2. if(method != null) {
  3. out.write(1);
  4. Util.objectToStream(method.getParameterTypes(),out);
  5. Util.objectToStream(method.getDeclaringClass(),out);
  6. }
  7. else
  8. out.write(0);
  9. }

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

  1. protected void writeArgs(DataOutput out, Marshaller marshaller) throws Exception {
  2. int args_len=args != null? args.length : 0;
  3. out.write(args_len);
  4. if(args_len == 0)
  5. return;
  6. for(Object obj: args) {
  7. if(marshaller != null)
  8. marshaller.objectToStream(obj, out);
  9. else
  10. Util.objectToStream(obj, out);
  11. }
  12. }

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeInt(values.size());
  3. for(Map.Entry<String,Object> entry: values.entrySet()) {
  4. Bits.writeString(entry.getKey(),out);
  5. Util.objectToStream(entry.getValue(), out);
  6. }
  7. }

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

  1. public void getState(OutputStream output) throws Exception {
  2. DataOutputStream out=new DataOutputStream(new BufferedOutputStream(output, 1000));
  3. try {
  4. synchronized(nodes) {
  5. Util.objectToStream(nodes, out);
  6. }
  7. }
  8. finally {
  9. Util.close(out);
  10. }
  11. }

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

  1. public void getState(OutputStream output) throws Exception {
  2. int[][] copy_of_state=canvas.getCopyOfState();
  3. Util.objectToStream(copy_of_state, new DataOutputStream(output));
  4. }

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

  1. public void getState(OutputStream ostream) throws Exception {
  2. Util.objectToStream(root.clone(), new DataOutputStream(ostream));
  3. }

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

  1. public void objectToStream(Object obj, DataOutput out) throws Exception {
  2. if(obj == null) {
  3. out.write(NULL);
  4. return;
  5. }
  6. if(obj instanceof Cache.Value) {
  7. Cache.Value value=(Cache.Value)obj;
  8. out.writeByte(VALUE);
  9. out.writeLong(value.getTimeout());
  10. Util.objectToStream(value.getValue(), out);
  11. }
  12. else {
  13. out.writeByte(OBJ);
  14. Util.objectToStream(obj, out);
  15. }
  16. }

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

  1. public void objectToStream(Object obj, DataOutput out) throws Exception {
  2. if(obj == null) {
  3. out.write(NULL);
  4. return;
  5. }
  6. if(obj instanceof Cache.Value) {
  7. Cache.Value value=(Cache.Value)obj;
  8. out.writeByte(VALUE);
  9. out.writeLong(value.getTimeout());
  10. Util.objectToStream(value.getValue(), out);
  11. }
  12. else {
  13. out.writeByte(OBJ);
  14. Util.objectToStream(obj, out);
  15. }
  16. }

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

  1. protected static Buffer replyToBuffer(Object obj, Marshaller marshaller) throws Exception {
  2. int estimated_size=marshaller != null? marshaller.estimatedSize(obj) : 50;
  3. ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(estimated_size, true);
  4. if(marshaller != null)
  5. marshaller.objectToStream(obj, out);
  6. else
  7. Util.objectToStream(obj, out);
  8. return out.getBuffer();
  9. }

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

  1. protected void writeMethod(DataOutput out) throws Exception {
  2. if(method != null) {
  3. out.write(1);
  4. Util.objectToStream(method.getParameterTypes(),out);
  5. Util.objectToStream(method.getDeclaringClass(),out);
  6. }
  7. else
  8. out.write(0);
  9. }

代码示例来源:origin: co.paralleluniverse/galaxy

  1. @Override
  2. public void getState(OutputStream ostream) throws Exception {
  3. synchronized (root) {
  4. LOG.info("State requested");
  5. // all modifications to the tree
  6. Util.objectToStream(root, new DataOutputStream(ostream));
  7. }
  8. }

代码示例来源:origin: org.axonframework/axon-distributed-commandbus

  1. @Override
  2. public void getState(OutputStream ostream) throws Exception {
  3. Util.objectToStream(consistentHash.get(), new DataOutputStream(ostream));
  4. }

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

  1. public void writeTo(DataOutput out) throws Exception {
  2. out.writeInt(values.size());
  3. for(Map.Entry<String,Object> entry: values.entrySet()) {
  4. Bits.writeString(entry.getKey(),out);
  5. Util.objectToStream(entry.getValue(), out);
  6. }
  7. }

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

  1. protected void writeArgs(DataOutput out, Marshaller marshaller) throws Exception {
  2. int args_len=args != null? args.length : 0;
  3. out.write(args_len);
  4. if(args_len == 0)
  5. return;
  6. for(Object obj: args) {
  7. if(marshaller != null)
  8. marshaller.objectToStream(obj, out);
  9. else
  10. Util.objectToStream(obj, out);
  11. }
  12. }

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

  1. protected static Buffer replyToBuffer(Object obj, Marshaller marshaller) throws Exception {
  2. int estimated_size=marshaller != null? marshaller.estimatedSize(obj) : 50;
  3. ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(estimated_size, true);
  4. if(marshaller != null)
  5. marshaller.objectToStream(obj, out);
  6. else
  7. Util.objectToStream(obj, out);
  8. return out.getBuffer();
  9. }

相关文章

Util类方法