xdrlib
xdrlib is used to encode and decode data in the Sun XDR (External Data Representation) format. XDR is often used as a portable way to encode binary data for use in networked applications. It’s used extensively in applications involving remote procedure calls (RPCs).
Encoding and decoding is controlled through the use of two classes:
Packer()
Creates an object for packing data into an XDR representation.
Unpacker(data)
Creates an object for unpacking XDR-encoded data. data is a string containing XDR-encoded data values.
An instance, p, of the Packer class supports the following methods:
p.get_buffer()
Returns the current pack buffer as a string.
p.reset()
Resets the pack buffer to the empty string.
p.pack_uint(x)
Packs a 32-bit unsigned ...
Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.