Skip to content

Tag: kotlin

How to download a file when a custom header is needed?

I want to download from a private repository in GitHub, so I need to pass the headers Authorization: token ${GITHUB_TOKEN} and Accept: application/vnd.github.v3.raw. For example, with curl: curl -H “Authorization: token ${GITHUB_TOKEN}” -H ‘Accept: application/vnd.github.v3.raw’ -o fil…

Why is Java Sound API frame position getting stuck?

I’m trying to create a sound recorder using Java Sound API on Kotlin Desktop. I want to automatically stop the recording after 3 seconds. The frame position does initially advance but then gets stuck. This is output of the print statement: What is causing this and is there a way to fix it? Answer The pr…