Google Protobuf Reader - Read Data

新项目须要 用 Java 读取 protobuf-net-data encode以后的数据,实在是个让人蛋疼的任务。java

protobuf-net-data 把 查询结果封装成 DataTable,用法本身参考原文git

这里说说我要作的事情
github

  • Understand Protobuf Encodingui

  • Decodinggoogle

  • Java ResultSetspa

  1. Protobuf how to encoding: Google Doccode

    a protocol buffer message is a series of key-value pairs
    get

message Test1 {
  required int32 a = 1;
}

08 96 01

08 = 0000 0001

 Each key in the streamed message is a varint with the value (field_number << 3) | wire_typeinput

int key = readVarInt(inputStream);
int wireType = key & 0x07 // 0000 0001
int fieldId = key >> 3    // right shift 3.


to be continue...it

相关文章
相关标签/搜索