Is your feature request related to a problem? Please describe.
Currently class id is written as 3 bytes:
| flag byte | two bytes short class id |
This is wasteful for space. For string/int/long/etc. classes, class id can be written using 1 bytes.
With this PR, class id will be
Describe the solution you'd like
New class id encoding format:
- use varint for class id encoding to reduce java class writing space cost.
- Use little endian order for class id encoding
- Use bit 0 as flag to indicate the class will be written using class id
- When reading, read one byte first, since writting use little endian, the bit 0 of read byte can be used as a flag to determine whether this class is written using class id. If so, read varint and
>>1 to get real class id. Otherwise, read class by classname instead.
Is your feature request related to a problem? Please describe.
Currently class id is written as 3 bytes:
This is wasteful for space. For string/int/long/etc. classes, class id can be written using 1 bytes.
With this PR, class id will be
Describe the solution you'd like
New class id encoding format:
>>1to get real class id. Otherwise, read class by classname instead.