Struct faiss::BufferedIOReader

struct BufferedIOReader : public faiss::IOReader

wraps an ioreader to make buffered reads to avoid too small reads

Public Functions

explicit BufferedIOReader(IOReader *reader, size_t bsz = 1024 * 1024)
Parameters:

bsz – buffer size (bytes). Reads will be done by batched of this size

virtual size_t operator()(void *ptr, size_t size, size_t nitems) override
virtual int filedescriptor()

Public Members

IOReader *reader
size_t bsz
size_t ofs

offset in input stream

size_t ofs2

number of bytes returned to caller

size_t b0
size_t b1

range of available bytes in the buffer

std::vector<char> buffer
std::string name