std.binary Package
Function Description
The binary package provides the following interfaces:
- Interface for conversion between a Cangjie data type and a binary byte sequence, which is classified into big-endian conversion and little-endian conversion; and
- Interface for big-endian and little-endian conversion of a Cangjie data type.
Notes:
- Generally, multi-byte objects are stored as consecutive byte sequences. In a memory or a digital communication link, the arranged order bytes is referred to as endianness, which is also referred to as a byte order.
- Bytes can be arranged in little-endian and big-endian modes. In little-endian mode, the least significant bit of a multi-bit number is stored at the smallest memory address and the most significant bit at the largest memory address, while in big-endian mode, the most significant bit is stored at the smallest memory address and the least significant bit at the largest memory address.
API List
Interface
Name | Description |
---|---|
BigEndianOrder<T> | Big-endian byte sequence conversion interface |
LittleEndianOrder<T> | Little-endian byte sequence conversion interface |
SwapEndianOrder<T> | Byte order reversion interface |