All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.binaryfoo.decoders.SometimesAsciiPrimitiveDecoder.kt Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package io.github.binaryfoo.decoders

import io.github.binaryfoo.tlv.ISOUtil

class SometimesAsciiPrimitiveDecoder : PrimitiveDecoder {
    override fun decode(hexString: String): String {
        val builder = StringBuilder()
        for (b in ISOUtil.hex2byte(hexString)) {
            if (Character.isISOControl(b.toInt())) {
                return hexString
            }
            builder.append(b.toChar())
        }
        return builder.toString()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy