pelican/core/test/src/TestStreamAdapter.cpp
/**
 * @details
 * Deserialises the data from the given QIODevice into a
 * TestDataBlob structure.
 *
 * @param[in] in    A pointer to the input device.
 */
@details
Deserialises the data from the given QIODevice into a
TestDataBlob structure.

@param[in] in    A pointer to the input device.
@details Deserialises the data from the given QIODevice into a TestDataBlob structure . @param [ in ] in A pointer to the input device .
void TestStreamAdapter::deserialise(QIODevice* in)
{
    TestDataBlob* blob = static_cast<TestDataBlob*>(_data);
    blob->resize(_chunkSize);
    while (in->bytesAvailable() < (qint64)_chunkSize)
        in->waitForReadyRead(-1);
    in->read( blob->data().data(), (quint64)_chunkSize);
}
void TestStreamAdapter :: deserialise ( QIODevice * in ) { TestDataBlob * blob = static_cast < TestDataBlob * > ( _data ) ; blob -> resize ( _chunkSize ) ; while ( in -> bytesAvailable ( ) < ( qint64 ) _chunkSize ) in -> waitForReadyRead ( -1 ) ; in -> read ( blob -> data ( ) . data ( ) , ( quint64 ) _chunkSize ) ; }
@details
 Deserialises the data from the given QIODevice into a
 TestDataBlob structure.
@details Deserialises the data from the given QIODevice into a TestDataBlob structure .
// Ensure there is enough data to read from the device.