Package com.jd.glowworm.serializer

Examples of com.jd.glowworm.serializer.SerializeWriter


import com.jd.glowworm.util.TypeUtils;

public class PB {
  public static byte[] toPBBytes(Object objectParm)
  {
    SerializeWriter tmpSerializeWriter = new SerializeWriter();
    PBSerializer tmpPBSerializer = new PBSerializer(tmpSerializeWriter);
   
    // 对象类型字符串
    Class<?> clazz = objectParm.getClass();
    tmpSerializeWriter.getCodedOutputStream().writeString(clazz.getName());
   
    tmpPBSerializer.write(objectParm);
    return tmpSerializeWriter.getCodedOutputStream().getBytes();
  }
View Full Code Here

TOP

Related Classes of com.jd.glowworm.serializer.SerializeWriter

Copyright © 2018 www.massapicom. 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.