https://kotlinlang.org logo
#stdlib
Title
# stdlib
e

Erik

11/28/2023, 11:11 AM
Like
kotlin.time
, is there a stdlib package to work with file sizes? E.g. I'd like to define how many bytes is 100MB, or 100MiB. That's
100 * 1000 * 1000
, or
100 * 1024 * 1024
respectively. Wouldn't it be nice to have extensions and utility functions for? Could maybe be inside
<http://kotlin.io|kotlin.io>
.
e

ephemient

11/28/2023, 11:26 AM
there isn't, but some third-party libraries like https://nacular.github.io/measured/ exist
l

LeoColman

11/28/2023, 11:59 AM
Adding to it, I don't think there's place in the STDlib for this. It seems to me a bit niché. It's not a common case to convert units IMO