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

相關文章
相關標籤/搜索