MCPcopy Create free account
hub / github.com/BaseXdb/basex / write

Method write

basex-core/src/main/java/org/basex/index/resource/Docs.java:67–79  ·  view source on GitHub ↗

Writes the document index. @param out output stream @throws IOException I/O exception

(final DataOutput out)

Source from the content-addressed store, hash-verified

65 * @throws IOException I/O exception
66 */
67 void write(final DataOutput out) throws IOException {
68 out.writeDiffs(docs());
69 if(dirty && pathIndex) {
70 // retrieve paths (must be called before file is opened for writing!)
71 final TokenList paths = paths();
72 // write paths
73 try(DataOutput doc = new DataOutput(data.meta.dbFile(DATAPTH))) {
74 doc.writeNum(paths.size());
75 for(final byte[] path : paths) doc.writeToken(path);
76 }
77 dirty = false;
78 }
79 }
80
81 /**
82 * Returns a list with the {@code pre} values of all document nodes.

Callers

nothing calls this directly

Calls 7

docsMethod · 0.95
pathsMethod · 0.95
writeDiffsMethod · 0.80
dbFileMethod · 0.80
sizeMethod · 0.65
writeNumMethod · 0.45
writeTokenMethod · 0.45

Tested by

no test coverage detected