You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stuarthalloway edited this page Nov 20, 2012
·
1 revision
Packed representations encode the type of a value and part of the value itself in a single byte. Fressian uses packed representations for integers, as well as for some small aggregate values.
Packed numbers
If you look at the Bytecodes table, you will see that the bytecodes from 0x00 to 0x40 directly represent the integers from 0x00 to 0x40. So for small integer values, both the type (integer) and the value are represented in a single byte.
Packed collections
Small collections can also have packed representations, where the bytecode indicates both the type and the length. For example, an array of a single byte 0x00 can be represented in Fressian as 0xd10x00, because the bytecode 0xd1 encodes "byte array of length 1".