Open tryashtar opened 1 year ago
Pretty sure it's only the null byte that matters here since string cloning takes O(n) time, but n
inserts to an array can take O(n^2)
time due to reallocation, I think for performance it's wisest to count the nulls and then append that many bytes to the pre-allocated buffer, and add a check to push another byte under a for loop for cloning (ofc under predicate of '\0'
Java decided that UTF-8 wasn't cool enough, and modified it: https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8
Of course, we need to support both