Встретил термин PackedLen
Оказалось, что это compressed integer
-------------------
http://www.pcreview.co.uk/forums/thread-1370022.php
The length is a compressed integer, stored using the compression
algorithm used in many other places in metadata. It's described in
Partition II, 22.2. Basicly it goes like this
If value is 0-127, store it in the 7 least significant bits in a
single byte, and set the MSB to 0).
If value is 128-0x3fff, store it in the 14 least significant bits of a
16-bit word, and set the two high bits to binary 10. This is what
you're seeing — the 8 comes from the high nibble being 1000.
Otherwise (if value is 0x4000-0x1fffffff) store in a 32-bit word with
the three high bits set to binary 110.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
Please reply only to the newsgroup.
-------------------
Если проще, то, чтобы определить в скольких байтах закодировано число, читаем первый байт.
Если 1-й высший бит = 0, то число закодировано в одно бите, а точнее в 7-ми его байтах, т.к. в данном случае высший байт служебный, не забывайте об этом кодка кодируете или раскодируете число.
Далее по аналогии если 2 высших вита = 10, то число закодировано в двух байтах (в 14 из 16-ти битов),
если 3 высших бита = 110, то число закодировано в 4-х байтах (в 29 из 32-х битов).
«Время жизни складывается не из количества прожитых вздохов, а из секунд в которые у тебя захватывает дыхание.»
(с) фильм «Метод Хитча»