I have an ArrayList of Bytes. Firstly, when i print them i see integers? And the second thing is, i want to convert each Byte to a Bitstring and add it to a new list of bitstrings. How do i do that as there is no "i.toBitString"?
fun preprocessing() {
val userInput = readLine()
val charset = Charsets.UTF_8
val bytearray = userInput?.toByteArray()
var bitsets = ArrayList<BitSet>()
if (bytearray != null) {
// for(i in bytearray){
// bitsets.add(i.toBitset?)}
}
}
preprocessing()
You can convert to any base with this method, in your case this should work:
here is the docs: