Qt Jambi
----------------------------
Example (write binary data to a stream):
QFile file = new QFile("file.dat");
QFile.OpenMode mode = new QFile.OpenMode();
mode.set(QFile.OpenModeFlag.WriteOnly);
file.open(mode);
QDataStream out = new QDataStream(file); // we will serialize the data into the file
out.writeString("the answer is"); // serialize a string
out.writeInt(42); // serialize an integer
Example (read binary data from a stream):
QFile file = new QFile("file.dat");
QFile.OpenMode mode = new QFile.OpenMode();
mode.set(QFile.OpenModeFlag.ReadOnly);
file.open(mode);
QDataStream in = new QDataStream(file); // read the data serialized from the file
// extract "the answer is" and 42
String str = in.readString();
int a = in.readInt();