QBuffer
( QObject * parent = 0 )
|
|
QBuffer
( QByteArray * byteArray, QObject * parent = 0 )
|
|
~QBuffer
()
|
|
QByteArray &
|
buffer
()
|
const QByteArray &
|
buffer
() const
|
const QByteArray &
|
data
() const
|
void
|
setBuffer
( QByteArray * byteArray )
|
void
|
setData
( const QByteArray & data )
|
void
|
setData
( const char * data, int size )
|
virtual bool
|
atEnd
() const
|
virtual bool
|
canReadLine
() const
|
virtual void
|
close
()
|
virtual bool
|
open
( OpenMode flags )
|
virtual qint64
|
pos
() const
|
virtual bool
|
seek
( qint64 pos )
|
virtual qint64
|
size
() const
|
virtual qint64
|
readData
( char * data, qint64 len )
|
virtual qint64
|
writeData
( const char * data, qint64 len )
|
QByteArray byteArray;
QBuffer buffer(&byteArray);
buffer.open(QIODevice::WriteOnly);
QDataStream out(&buffer);
out << QApplication::palette();
QPalette palette;
QBuffer buffer(&byteArray);
buffer.open(QIODevice::ReadOnly);
QDataStream in(&buffer);
in >> palette;
QByteArray byteArray("abc");
QBuffer buffer(&byteArray);
buffer.open(QIODevice::WriteOnly);
buffer.seek(3);
buffer.write("def", 3);
buffer.close();
// byteArray == "abcdef"
QByteArray byteArray("abc");
QBuffer buffer;
buffer.setBuffer(&byteArray);
buffer.open(QIODevice::WriteOnly);
buffer.seek(3);
buffer.write("def", 3);
buffer.close();
// byteArray == "abcdef"