MCPcopy Create free account
hub / github.com/e2wugui/zeze / toString

Method toString

ZezeJava/ZezeJava/src/main/java/Zeze/Util/JsonWriter.java:705–734  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

703 }
704
705 @Override
706 public @NotNull String toString() {
707 if (BYTE_STRING) { // for JDK9+
708 byte[] b;
709 int i, n;
710 if (tail == tail.next) {
711 b = buf;
712 n = pos;
713 } else {
714 b = toBytes();
715 n = b.length;
716 }
717 for (i = 0; i < n; i++)
718 if (b[i] < 0)
719 break;
720 if (i == n) {
721 try {
722 return (String)Json.stringCtorMH.invokeExact((byte[])(b == buf ? Arrays.copyOf(b, n) : b), (byte)0);
723 } catch (Throwable e) { // MethodHandle.invoke
724 throw new RuntimeException(e);
725 }
726 }
727 return new String(b, 0, n, StandardCharsets.UTF_8);
728 }
729 try {
730 return (String)Json.stringCtorMH.invokeExact(toChars(), false);
731 } catch (Throwable e) { // MethodHandle.invoke
732 throw new RuntimeException(e);
733 }
734 }
735
736 public static long umulHigh(long a, long b) { // for JDK8-
737 long a1 = a >> 32;

Callers 2

testDoubleRangeMethod · 0.95
testDoubleRandomMethod · 0.95

Calls 2

toBytesMethod · 0.95
toCharsMethod · 0.95

Tested by 2

testDoubleRangeMethod · 0.76
testDoubleRandomMethod · 0.76