This module provides a monad for serializing data into byte strings. It provides mostly the same interface that Data.Binary.Put does. However, the implementation is different. It allows for the data to be serialized into an existing array of Word8 values. This differs from the Data.Binary.Put data type, which allocates a Word8 array every time a value is serialized. This module's implementation is useful if you want to reuse the Word8 array for many serializations. In the case of an OpenFlow server, we can reuse a buffer to send messages, since we have no use for the the Word8 array, except to pass it to an IO procedure to write the data to a socket or file.
Runs the Put writer with write position given by the first pointer argument. Returns the number of words written.
Allocates a new byte string, and runs the Put writer with that byte string. The first argument is an upper bound on the size of the array needed to do the serialization.