Struct Padding

后端 未结 6 449
忘掉有多难
忘掉有多难 2021-01-23 00:09

I am trying to read chunks of data from a file directly into a struct but the padding is causing too much data to be read and the data to be misaligned.

Do I have to man

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-23 00:37

    If you are reading and writing this file yourself, try Google Protobuf library. It will handle all byteorder, alignment, padding and language interop issues.

    http://code.google.com/p/protobuf/

提交回复
热议问题