|
|||||
|
||||||
Other Library Functions |
function |
netutil.to-net32 |
Library: Net, Network utilities (OMNETUTIL)
Import: omnetutl.xmd |
Return type: Integer Returns: Returns a number encoded as a 32-bit binary value, with the bytes in network order. |
netutil.to-net32 (c)
Argument definitions
Use netutil.to-net32 to translate an integer value into a sequence of bytes/octets that is the integer value's long network number encoding.
This program creates a file containing the numbers from 0 to 1,000,000 (counting by 1,000s). It stores the numbers in network-ordered binary format, to create a smaller, platform-independent file.
import "omnetutil.xmd" prefixed by netutil. process local stream s open s with binary-mode as file "net32.dat" using output as s repeat for integer i from 0 to 1000000 by 1000 output netutil.to-net32 i again close s
This file can be read on any platform, with the same results.
Other Library Functions netutil.from-net32 netutil.host-ip netutil.host-name netutil.net32 netutil.omnetutil-version netutil.to-net32 |