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

Method get

basex-core/src/main/java/org/basex/query/value/item/Str.java:64–73  ·  view source on GitHub ↗

Returns an instance of this class. @param value value @return instance

(final byte[] value)

Source from the content-addressed store, hash-verified

62 * @return instance
63 */
64 public static Str get(final byte[] value) {
65 final int vl = value.length;
66 if(vl == 0) return EMPTY;
67 if(vl == 1) return CHAR[value[0]];
68 if(vl > 4 || vl > Token.cl(value, 0)) return new Str(value);
69 // cache single characters
70 synchronized(CACHE) {
71 return CACHE.computeIfAbsent(Token.cp(value, 0), () -> new Str(value));
72 }
73 }
74
75 /**
76 * Returns an instance of this class.

Callers 15

writeMultipartMessageMethod · 0.95
writeMessageMethod · 0.95
multipartResponseMethod · 0.95
multipartRespPreambleMethod · 0.95
addParamsMethod · 0.95
bindMethod · 0.95
bindMethod · 0.95
toStrMethod · 0.95
itemMethod · 0.95
valueMethod · 0.95
itemMethod · 0.95
idMethod · 0.95

Calls 7

clMethod · 0.95
cpMethod · 0.95
cpTokenMethod · 0.95
tokenMethod · 0.95
checkMethod · 0.95
getMethod · 0.65
computeIfAbsentMethod · 0.45

Tested by 15

writeMultipartMessageMethod · 0.76
writeMessageMethod · 0.76
multipartResponseMethod · 0.76
multipartRespPreambleMethod · 0.76
finishMethod · 0.76
fastMethod · 0.76
functionNSMethod · 0.76
gh1779Method · 0.76
setupMethod · 0.76
instanceOfMethod · 0.76
queryBindSequenceMethod · 0.76
getMethod · 0.76