50 CubeBsqHandler::CubeBsqHandler(QFile * dataFile,
51 const QList<int> *virtualBandList,
const Pvl &labels,
bool alreadyOnDisk)
52 :
CubeIoHandler(dataFile, virtualBandList, labels, alreadyOnDisk) {
54 int numLinesInChunk = 1;
58 int sizeLimit = 1024 * 1024 * 1024;
59 int maxNumLines = (sizeLimit) / (
SizeOf(
pixelType()) * numSamplesInChunk);
82 PvlContainer::Replace);
92 if(dataFile->seek(startByte)) {
93 QByteArray binaryData = dataFile->read(chunkToFill.
getByteCount());
102 IString msg =
"Reading from the file [" + dataFile->fileName() +
"] "
103 "failed with reading [" +
105 "] bytes at position [" + QString::number(startByte) +
"]";
114 bool success =
false;
117 if(dataFile->seek(startByte)) {
118 BigInt dataWritten = dataFile->write(chunkToWrite.
getRawData());
126 IString msg =
"Writing to the file [" + dataFile->fileName() +
"] "
127 "failed with writing [" +
129 "] bytes at position [" + QString::number(startByte) +
"]";
145 int chunkDimensionSize;
147 if (dimensionSize <= maxSize) {
148 chunkDimensionSize = dimensionSize;
152 int greatestDivisor = maxSize;
153 while (dimensionSize % greatestDivisor > 0) {
156 chunkDimensionSize = greatestDivisor;
158 return chunkDimensionSize;