Skip to content

Commit 60b8f4e

Browse files
committed
Demo using a kotlin 2.0 stdlib feature
1 parent 18b0bef commit 60b8f4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

services/shellexecutor/java/androidx/test/services/shellexecutor/LocalSocketProtocol.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ object LocalSocketProtocol {
5252
env: Map<String, String>? = null,
5353
timeout: Duration,
5454
) {
55+
val myString = "Kotlin is awesome!"
56+
val destinationArray = CharArray(myString.length)
57+
58+
// Convert the string and store it in the destinationArray:
59+
myString.toCharArray(destinationArray)
60+
5561
val builder = RunCommandRequest.newBuilder().setSecret(secret).addAllArgv(argv)
5662
env?.forEach { (k, v) -> builder.putEnvironment(k, v) }
5763
if (timeout.isInfinite() || timeout.isNegative() || timeout == Duration.ZERO) {

0 commit comments

Comments
 (0)