xdrlib.Unpacker.get_buffer()

Unpacker.get_buffer() Returns the current unpack data buffer as a string.

xdrlib.Unpacker.unpack_array()

Unpacker.unpack_array(unpack_item) Unpacks and returns a variable length list of homogeneous items. First, the length of the list is unpacked as an unsigned integer, then each element is unpacked as in unpack_farray() above.

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_fopaque()

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

xdrlib.Packer.reset()

Packer.reset() Resets the pack buffer to the empty 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_float()

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

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_opaque()

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

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.