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

Method toBytes

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

Source from the content-addressed store, hash-verified

649 }
650
651 public byte[] toBytes() {
652 Block block = tail.next;
653 if (block == tail)
654 return Arrays.copyOf(buf, pos);
655 tail.len = pos;
656 int p = 0;
657 for (; ; block = block.next) {
658 p += block.len;
659 if (block == tail)
660 break;
661 }
662 byte[] res = new byte[p];
663 p = 0;
664 for (block = tail.next; ; block = block.next) {
665 System.arraycopy(block.buf, 0, res, p, block.len);
666 p += block.len;
667 if (block == tail)
668 return res;
669 }
670 }
671
672 public char[] toChars() {
673 char[] res = new char[charSize()];

Callers 3

toStringMethod · 0.95
toCompactBytesMethod · 0.45
writeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected