title: Convert ByteArray to Base64 in Kotlin
body: <p>I am trying to convert a ByteArray to Base64 in a Spring project, written in Kotlin. I have checked existing posts but they didnt help me. Actually I am trying to convert a blob to base, but I converted the blob to byteArray so far and am struggling now to convert the bytearray to base64. This is what I am currently trying:</p>
  <pre><code>var inByteArray = Base64.encodeBase64(blobAsBytes)         //inByteArray : ByteArray!
  var inByteArrayFormatted = Base64Utils.decode(inByteArray) //inByteArrayFormatted : ByteArray
  </code></pre>
  <p>I tried the things from this post <a href="https://stackoverflow.com/questions/2418485/how-do-i-convert-a-byte-array-to-base64-in-java">How do I convert a byte array to Base64 in Java?</a>, but they are just encoding strings but not directly to Base64. How can I convert a byte array to Base64? Not encoded strings but Base64?</p>
  <p>Thanks for every help!</p>