Library binary

To use this library in your code:

import binary
Support for byte-order aware manipulation of byte arrays.
The little-endian byte order (generally used by all modern CPUs) stores the least-significant byte at the lowest address. Use LITTLE-ENDIAN (a singleton instance of LittleEndian) to manipulate byte arrays in this order.
The big-endian byte order stores the most-significant byte at the lowest address. It is frequently used in networking. Use BIG-ENDIAN (a singleton instance of BigEndian) to manipulate byte arrays in this order.

Exported classes

Support for big endian byte order.

A byte order class with support for common read and write operations on byte arrays.

Support for little endian byte order.

Globals

Deprecated. Use io.BIG-ENDIAN instead.

Deprecated. Use int.MAX-16 instead.

Deprecated. Use int.MIN-16 instead.

Deprecated. Use int.MAX-24 instead.

Deprecated. Use int.MIN-24 instead.

Deprecated. Use int.MAX-32 instead.

Deprecated. Use int.MIN-32 instead.

Deprecated. Use int.MAX-8 instead.

Deprecated. Use int.MIN-8 instead.

Deprecated. Use io.LITTLE-ENDIAN instead.

Deprecated. Use int.MAX-U16 instead.

Deprecated. Use int.MAX-U24 instead.

Deprecated. Use int.MAX-U32 instead.

Deprecated. Use int.MAX-U8 instead.

Functions

byte-swap-16 byte-array/ByteArray -> none
Swaps the byte-order of all 16-bit integers in the byte-array.
If the integers were in little-endian order they then are in big-endian byte order
If the integers were in big-endian order they then are in little-endian byte order.
Deprecated. Use io.ByteOrder.swap-16 instead.

byte-swap-32 byte-array/ByteArray -> none
Swaps the byte-order of all 32-bit integers in the byte-array.
If the integers were in little-endian order they then are in big-endian byte order
If the integers were in big-endian order they then are in little-endian byte order.
Deprecated. Use io.ByteOrder.swap-32 instead.