Rosetta's IO functions provide low level file reading and writing support. IO functions provides support for reading and writing in plain text and binary form. In addition to providing reading and writing support, Rosetta also have functions to automatically convert simple data types such as char, short, long, double, and float. These conversions are important for parsing and writing data format such as BMP correctly.
When Base64 is paired with Rosetta's file IO functions, Director developers can read and write files to support the MIME standard. The programmers File Format Collections contains a wealth of information about various data formats.
A note on working with binary strings in Director:
It should be noted that some of Rosetta's documentation refers to string as binary string. Binary strings simply refers to the possibility that the string values may contain several numToChar(0), also known as NULL, characters. These null characters are problematic when working with Director's message window, field member, and script window because these windows will stop the output at the sight of the first NULL characters. By mentioning binary string in the documentation, we are referring to the ability of that function to read pass the NULL characters until the actual end of the string.
There are also several functions that return binary strings. To work with binary string, you can output the binary string into a text member. Another way to work with binary string, is to use the string.length property to examine the actual string length. To access individual bytes, use charToNum( string.char[x] ) to retrieve the byte value for each character.
Method |
|
|---|---|
ioOpen() |
ioWriteEx() |
ioSize() |
ioGetPos() |
ioRead() |
ioSetPos() |
ioReadEx() |
ioClose() |
ioReadLine() |
ioIsOpen() |
ioWrite() |
|