.proto Type

  Notes C++ Type Java Type
double    double  double
float    float  float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.  int32  int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.  int64  long
uint32 Uses variable-length encoding.  uint32  int
uint64 Uses variable-length encoding.  uint64  long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.  int32  int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.   int64  long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 228  uint32  int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 256.  uint64  long
sfixed32 Always four bytes.  int32  int
sfixed64 Always eight bytes.  int64  long
bool    bool  boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text.  string  String
bytes May contain any arbitrary sequence of bytes. string ByteString

public static Dictionary<string, string> MySqlToProbuffer = new Dictionary<string, string>()
        {
            {"varchar", "string"},
            {"longtext", "string"},
            {"text", "string"},
            {"char", "string"},
            {"mediumtext", "string"},
            {"bigint", "int64"},
            {"datetime", "int64"},
            {"timestamp", "int64"},
            {"int", "int32"},
            {"tinyint", "int32"},
            {"smallint", "int32"},
            {"decimal", "double"},
            {"double", "double"},
            {"float", "float"},
            {"bit", "bool"},
            {"blob", "bytes"},
            {"longblob", "bytes"},
            {"varbinary", "bytes"},
            {"binary", "bytes"}
        };

public static Dictionary<string, string> ProbufferToJava = new Dictionary<string, string>()
        {
            {"string", "String"},
            {"int32", "Integer"},
            {"int64", "Long"},
            {"double", "Double"},
            {"float", "Float"},
            {"bool", "Boolean"},
            {"bytes", "ByteString"},
            {"uint32", "Integer"},
            {"uint64", "Long"},
            {"sint32", "Integer"},
            {"sint64", "Long"},
            {"fixed32", "Integer"},
            {"fixed64", "Long"},
            {"sfixed32", "Integer"},
            {"sfixed64", "Long"},
        };

最新文章

  1. JRebel Windows RegCreateKeyEx(...) returned error code 5.
  2. 纯CSS完成tab实现5种不同切换对应内容效果
  3. Python实现支持并发、断点续传的FTP
  4. DataTable使用技巧总结【转】
  5. HDU2680 Choose the best route 最短路 分类: ACM 2015-03-18 23:30 37人阅读 评论(0) 收藏
  6. IIS7报错:如果要使用托管的处理程序,请安装 ASP.NET
  7. 数据结构(线段树):Educational Codeforces Round 6 620E. New Year Tree
  8. android layout的布局
  9. SQL学习之使用常用函数处理数据
  10. Qt中利用QTime类来控制时间,这里简单介绍一下QTime的成员函数的用法:
  11. Spark2.1.0——Spark初体验
  12. CSS中的一下小技巧2之CSS3动画勾选运用
  13. sqlite处理数据
  14. Shiro自定义过滤器
  15. Spark RDD Action 简单用例(一)
  16. &lt;转&gt;jmeter(十三)常见问题及解决方法
  17. 【Hadoop 分布式部署 一 :分布式部署准备虚拟机 】
  18. Delphi实现菜单项上出现提示
  19. AndroidStudio不自己主动加入新创建的文件到VCS
  20. 安卓程序代写 网上程序代写[转]SVN 在线代码托管工具

热门文章

  1. 在执行一行代码之前CLR做的68件事[The 68 things the CLR does before executing a single line of your code]
  2. ELK显示多行日志
  3. AWS系列-创建AMI
  4. 使用openstack部署云计算服务环境
  5. css位置相关元素
  6. 【BZOJ3211】花神游历各国 并查集+树状数组
  7. spring @Transactional注解参数详解(转载)
  8. Jwt在javaweb项目中的应用核心步骤解读
  9. Python全栈day18(迭代器协议和for循环工作机制)
  10. ionic 上拉加载问题(分页)