title: Encoding, datatypes & packed repeated fields
body: <p>I have some questions regarding packed fields, and storing/serializing
  data with protocolbuffers.
  What i want to do essentially, is to store 4MB of data to a file.</p>
  
  <p>The data i have (in our embedded system) is received as uint8_t (a byte) and i want to store this data as efficiently as possible.</p>
  
  <p>I have been testing a variety of protobuf setups (four);</p>
  
  <pre><code>repeated uint32_t datastruct = 1;
  repeated uint32_t datastruct = 1 [packed = true]
  </code></pre>
  
  <p>with both variants assigned 1-to-1 (putting a uint8 to uint32) and both variants bitshifted with 4 values cramped into a uint32_t.</p>
  
  <p>To my surprise the stored files are much larger than the original
  data. (the examples where i put a uint8 into uint32 was expected of course..)
  The best result i could achieve was 5.2MB for the 4MB data, which
  really isnt that good.</p>
  
  <p>Have i misunderstood something vital here?
  I do realize that protobuf adds information to the packets, but 25%
  increase is too much imho.</p>
  
  <p>Also using GzipOutputStream increases the size of the file instead of decreasing it.</p>
  
  <p>Any tips would be very appreciated!</p>
  
  <p>Thanks for your time.</p>