return NULL;
}
+bool CollectionReader::ensureBufferCapacity(size_t byteCount) {
+ while (!readerInput->isEOF() && (growingBuffer.getRemaining() < byteCount)) {
+ GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] only %d bytes remaning, need at least %d, reading more bytes.\n", __FILE__, __LINE__, growingBuffer.getRemaining(), byteCount);
+ readMoreBytes();
+ }
+ if (readerInput->isEOF() && (growingBuffer.getRemaining() < byteCount)) {
+ GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] need %d more bytes, but file is EOF.\n", __FILE__, __LINE__, (byteCount - growingBuffer.getRemaining()));
+ return false;
+ }
+ return true;
+}
+
void CollectionReader::readMoreBytes() {
char buffer[1024];
size_t readBytes;