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();
}