In the latest 1.3.40 change log, I saw `String.enc...
# announcements
p
In the latest 1.3.40 change log, I saw
String.encodeToByteArray
experimental API introduced there. And I have been using
String.toByteArray
since always. I want to know why there is such redundancy? What's the difference between them? (I don't think there is much or any difference at all)
m
String.toByteArray
is available only on the JVM and likely uses the Java standard library internally.
String.encodeToByteArray
is cross-platform and doesn't depend on Java.
👆 1
p
Does the new function utilise the existing method on the JVM?
m
p
Many thanks to you 🙏
g
Make sense, if you reuse platform implementation you do not distribute your code with stdlib, but also can reuse platform specific optimizations of JVM