MCPcopy Create free account
hub / github.com/apache/solr / toUTF8

Method toUTF8

solr/solrj/src/java/org/apache/solr/common/util/Utils.java:273–277  ·  view source on GitHub ↗
(CharArr out)

Source from the content-addressed store, hash-verified

271 byte[] arr = new byte[out.size() * 3];
272 int nBytes = ByteUtils.UTF16toUTF8(out, 0, out.size(), arr, 0);
273 return Arrays.copyOf(arr, nBytes);
274 }
275
276 public static Object fromJSON(byte[] utf8) {
277 // Need below check in both fromJSON methods since
278 // utf8.length returns a NPE without this check.
279 if (utf8 == null || utf8.length == 0) {
280 return Map.of();

Callers 2

testTypesMethod · 0.95
toJSONMethod · 0.95

Calls 2

UTF16toUTF8Method · 0.95
sizeMethod · 0.65

Tested by 1

testTypesMethod · 0.76