'What is the equivalent of Rust's Vec<u8> in Java/Kotlin?

What is the equivalent type of Vec in rust to Java/kotlin?

Vec<u8> return [48, 130, 6, 55, 2, 1, 3, 48, 130, 5, 253, 6, 9, 42, 134, 72, 134, ...] in rust.

I tried using ByteArray in kotlin but as you can see few elements are out of byte range it gives out of bounds. Should we use IntArray? Or something else?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source