Kotlin / kotlinx-io

Kotlin multiplatform I/O library
Apache License 2.0
1.22k stars 56 forks source link

Tidy up samples to make them more kotlin-playground-friendly #380

Open fzhinkin opened 1 week ago

fzhinkin commented 1 week ago

kotlinx-io was recently added to Kotlin Playground.

Some samples could not be executed there directly due to missing imports. Others, when executed, prints nothing (as they only have asserts). Perhaps, we should follow a path taken by Kotlin Stdlib and replace asserts with print statements in rendered samples.

fzhinkin commented 1 week ago

Imports will be fixed here: https://github.com/Kotlin/kotlinx-io/pull/382

fzhinkin commented 1 week ago

Some samples use unsigned integer types to represent internal state (CRC32, for example), which contradicts guidelines on how these types should be used.