05nelsonm / encoding

A Kotlin Multiplatform library for configurable, streamable, efficient and extensible Encoding/Decoding with support for base16/32/64.
Apache License 2.0
33 stars 5 forks source link

`decode` extension function should fill if resized #110

Closed 05nelsonm closed 1 year ago

05nelsonm commented 1 year ago

-EncoderDecoder.decode extension function resizes the ByteArray in the event there was ignored input resulting in a not perfectly sized array.

image

It should copy, fill, then return the copy.

val copy = ba.copyOf(i)
ba.fill(0, toIndex = i)
copy