Ticket #988 (assigned defect)

Opened 2 years ago

Last modified 2 years ago

libsoy bitpacker

Reported by: ArcRiley Owned by: ArcRiley
Priority: High Milestone: beta3
Component: Importer Version: Trunk
Keywords: Cc:

Description

In order to support import/export methods for PySoy classes cleanly we need a class which can handle packing and unpacking data of arbitrary meaning and bit length.

Methods of this class may include;

read_uint(bits : int) : int to read a number of bits from the stream, from 1 to 32, and return them as an integer.

read_int(bits : int) : int to read 1 to 31 bits plus a sign bit (highest order)

read_bool() : bool is an alias for (bool) read_uint(1)

read_double() : double to read 64 bits and return a double

read_label() : string to read a byte for length then 0-255 bytes which are returned as a string.

read_nstring(bytes : int) : string reads the specified number of bytes and returns a string. Useful for when the format specifies fixed-length strings or in cases where strings of > 255 bytes are needed.

... and the write versions of these as well.

Byte packing should be in network byte order (most significant byte first) and converted to/from native byte order.

Change History

comment:1 Changed 2 years ago by ArcRiley

  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.