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

Method textLen

basex-core/src/main/java/org/basex/data/DiskData.java:288–297  ·  view source on GitHub ↗
(final int pre, final boolean text)

Source from the content-addressed store, hash-verified

286 }
287
288 @Override
289 public int textLen(final int pre, final boolean text) {
290 final long value = textRef(pre);
291 if(Inline.inlined(value)) return Inline.unpackLength(value);
292
293 final DataAccess da = text ? texts : values;
294 final int l = da.readNum(value & Compress.COMPRESS - 1);
295 // if text is compressed, read number of compressed bytes
296 return Compress.compressed(value) ? da.readNum() : l;
297 }
298
299 /**
300 * Returns a text (text, comment, pi) or attribute value.

Callers

nothing calls this directly

Calls 5

textRefMethod · 0.95
inlinedMethod · 0.95
unpackLengthMethod · 0.95
readNumMethod · 0.95
compressedMethod · 0.95

Tested by

no test coverage detected