14 buffer.open(QBuffer::ReadWrite);
15 buffer.write(
"Qt rocks!");
28 QBuffer buffer(&byteArray);
29 buffer.open(QIODevice::WriteOnly);
31 QDataStream out(&buffer);
32 out << QApplication::palette();
42 QBuffer buffer(&byteArray);
43 buffer.open(QIODevice::ReadOnly);
45 QDataStream in(&buffer);
53 QByteArray byteArray(
"abc");
54 QBuffer buffer(&byteArray);
55 buffer.open(QIODevice::WriteOnly);
57 buffer.write(
"def", 3);
66 QByteArray byteArray(
"abc");
68 buffer.setBuffer(&byteArray);
69 buffer.open(QIODevice::WriteOnly);
71 buffer.write(
"def", 3);
77int main(
int argc,
char *argv[])
79 QApplication app(argc, argv);
int main(int argc, char *argv[])
[2]
static void main_snippet()
static void bytearray_ptr_ctor_snippet()
static void setBuffer_snippet()
static void write_datastream_snippets()
static void read_datastream_snippets()