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

Method unpackString

basex-core/src/main/java/org/basex/util/Inline.java:145–156  ·  view source on GitHub ↗

Extracts an inlined string. @param value inlined value @return token

(final long value)

Source from the content-addressed store, hash-verified

143 * @return token
144 */
145 private static byte[] unpackString(final long value) {
146 final int tl = (int) (value >> 32) & 0x0F, v = (int) value;
147 final byte[] token = new byte[tl];
148 if(tl <= 4) {
149 // short token
150 for(int t = 0, c = 24; t < tl; t++, c -= 8) token[t] = (byte) (v >> c);
151 } else {
152 // whitespace token
153 for(int t = 0, c = 30; t < tl; t++, c -= 2) token[t] = WS[v >> c & 3];
154 }
155 return token;
156 }
157}

Callers 3

unpackMethod · 0.95
unpackLongMethod · 0.95
unpackDoubleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected