Examples of Hessian2Output


Examples of com.alibaba.citrus.hessian.io.Hessian2Output

*
* @author Michael Zhou
*/
public class HessianSerializer implements Serializer {
    public void serialize(Object objectToEncode, OutputStream os) throws Exception {
        Hessian2Output ho = null;

        try {
            ho = new Hessian2Output(os);
            ho.writeObject(objectToEncode);
        } finally {
            if (ho != null) {
                try {
                    ho.close();
                } catch (IOException e) {
                }
            }
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.hessian.io.Hessian2Output

*
* @author Michael Zhou
*/
public class HessianSerializer implements Serializer {
    public void serialize(Object objectToEncode, OutputStream os) throws Exception {
        Hessian2Output ho = null;

        try {
            ho = new Hessian2Output(os);
            ho.writeObject(objectToEncode);
        } finally {
            if (ho != null) {
                try {
                    ho.close();
                } catch (IOException e) {
                }
            }
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.hessian.io.Hessian2Output

*
* @author Michael Zhou
*/
public class HessianSerializer implements Serializer {
    public void serialize(Object objectToEncode, OutputStream os) throws Exception {
        Hessian2Output ho = null;

        try {
            ho = new Hessian2Output(os);
            ho.writeObject(objectToEncode);
        } finally {
            if (ho != null) {
                try {
                    ho.close();
                } catch (IOException e) {
                }
            }
        }
    }
View Full Code Here

Examples of com.alibaba.com.caucho.hessian.io.Hessian2Output

    CompactedObjectOutputStream oos = new CompactedObjectOutputStream(os);
    oos.writeObject(data);
    System.out.println("compacted java:"+Bytes.bytes2hex(os.toByteArray())+":"+os.size());

    os = new ByteArrayOutputStream();
    Hessian2Output h2o = new Hessian2Output(os);
    h2o.writeObject(data);
    h2o.flushBuffer();
    System.out.println("hessian:"+Bytes.bytes2hex(os.toByteArray())+":"+os.size());

    os = new ByteArrayOutputStream();
    Builder<long[]> lb = Builder.register(long[].class);
    lb.writeTo(data, os);
View Full Code Here

Examples of com.alibaba.com.caucho.hessian.io.Hessian2Output

    int len = 0;
    long now = System.currentTimeMillis();
    for(int i=0;i<500;i++)
    {
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      Hessian2Output out = new Hessian2Output(os);
      out.writeObject(bean);
      out.flushBuffer();
      os.close();
      if( i == 0 )
        len = os.toByteArray().length;
      ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
      Hessian2Input in = new Hessian2Input(is);
View Full Code Here

Examples of com.alibaba.com.caucho.hessian.io.Hessian2Output

{
  private final Hessian2Output mH2o;

  public Hessian2ObjectOutput(OutputStream os)
  {
    mH2o = new Hessian2Output(os);
    mH2o.setSerializerFactory(Hessian2SerializerFactory.SERIALIZER_FACTORY);
  }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Output

  {
    if (log.isLoggable(Level.FINEST)) {
      os = new HessianDebugOutputStream(os, log, Level.FINEST);
    }
   
    _out = new Hessian2Output(os);
    _out.setSerializerFactory(factory);
  }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Output

  }

  @Override
  public void close()
  {
    Hessian2Output out = _out;
    _out = null;

    if (out != null) {
      try {
        out.close();
      } catch (IOException e) {
        log.log(Level.FINEST, e.toString(), e);
      }
    }
  }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Output

  private HashMap<String,Integer> _addressCache = new HashMap<String,Integer>(256);
  private String []_addressCacheRing = new String[256];

  public HmtpWriter()
  {
    _out = new Hessian2Output();
   
    if (log.isLoggable(Level.FINEST)) {
      _dOut = new HessianDebugOutputStream(log, Level.FINEST);
    }
  }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Output

                      Serializable payload)
    throws IOException
  {
    init(os);

    Hessian2Output out = _out;

    if (out == null)
      return;

    if (log.isLoggable(Level.FINEST)) {
      log.finest(this + " message " + payload
                + " {to:" + to + ", from:" + from + "}");
    }

    out.writeInt(HmtpPacketType.MESSAGE.ordinal());
    writeAddress(out, to);
    writeAddress(out, from);
    out.writeObject(payload);

    out.flushBuffer();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.