February 2006
Intermediate to advanced
648 pages
14h 53m
English
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 ...
Read now
Unlock full access