xdrlib.Unpacker.done()

Unpacker.done() Indicates unpack completion. Raises an Error exception if all of the data has not been unpacked.

xdrlib.Unpacker

class xdrlib.Unpacker(data) Unpacker is the complementary class which unpacks XDR data values from a string buffer. The input buffer is given as data.

xdrlib.Packer.reset()

Packer.reset() Resets the pack buffer to the empty string.

xdrlib.Packer.pack_string()

Packer.pack_string(s) Packs a variable length string, s. The length of the string is first packed as an unsigned integer, then the string data is packed with pack_fstring().

xdrlib.Packer.pack_opaque()

Packer.pack_opaque(data) Packs a variable length opaque data string, similarly to pack_string().

xdrlib.Packer.pack_list()

Packer.pack_list(list, pack_item) Packs a list of homogeneous items. This method is useful for lists with an indeterminate size; i.e. the size is not available until the entire list has been walked. For each item in the list, an unsigned integer 1 is packed first, followed by the data value from the list. pack_item is the function that is called to pack the individual item. At the end of the list, an unsigned integer 0 is packed. For example, to pack a list of integers, the code might appear

xdrlib.Packer.pack_fstring()

Packer.pack_fstring(n, s) Packs a fixed length string, s. n is the length of the string but it is not packed into the data buffer. The string is padded with null bytes if necessary to guaranteed 4 byte alignment.

xdrlib.Packer.pack_fopaque()

Packer.pack_fopaque(n, data) Packs a fixed length opaque data stream, similarly to pack_fstring().

xdrlib.Packer.pack_float()

Packer.pack_float(value) Packs the single-precision floating point number value.

xdrlib.Packer.pack_farray()

Packer.pack_farray(n, array, pack_item) Packs a fixed length list (array) of homogeneous items. n is the length of the list; it is not packed into the buffer, but a ValueError exception is raised if len(array) is not equal to n. As above, pack_item is the function used to pack each element.