MCPcopy Create free account
hub / github.com/apache/orc / readFully

Function readFully

c++/src/DictionaryLoader.cc:27–41  ·  view source on GitHub ↗

Helper function to read data fully from a stream

Source from the content-addressed store, hash-verified

25
26 // Helper function to read data fully from a stream
27 void readFully(char* buffer, int64_t bufferSize, SeekableInputStream* stream) {
28 int64_t posn = 0;
29 while (posn < bufferSize) {
30 const void* chunk;
31 int length;
32 if (!stream->Next(&chunk, &length)) {
33 throw ParseError("bad read in readFully");
34 }
35 if (posn + length > bufferSize) {
36 throw ParseError("Corrupt dictionary blob");
37 }
38 memcpy(buffer + posn, chunk, static_cast<size_t>(length));
39 posn += length;
40 }
41 }
42
43 } // namespace
44

Callers 1

loadStringDictionaryFunction · 0.70

Calls 2

ParseErrorClass · 0.85
NextMethod · 0.45

Tested by

no test coverage detected