Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support java.io.BufferedWriter #5014

Open
@ThijsBroersen

Description

@ThijsBroersen

While trying to cross-compile some zio-json code for supporting streaming json-lines, I ran into the issue that java.io.BufferedWriter was not implemented in Scala-js.
I was also cross-compiling to Scala-native and there the BufferedWriter class is implemented. I tried to use the same implementation for Scala-js and it turns out it just works out of the box. This is the implementation: https://github.com/scala-native/scala-native/blob/d5d65e755a4fb40a1c562d50b046384000232b23/javalib/src/main/scala/java/io/BufferedWriter.scala#L4

Can this be included in Scala-js?
I could make a PR with this single file and include e.g. this test: https://github.com/scala-native/scala-native/blob/d5d65e755a4fb40a1c562d50b046384000232b23/unit-tests/shared/src/test/scala/org/scalanative/testsuite/javalib/io/BufferedWriterTest.scala#L10
Anything else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing javalibReport of something from the JDK that is missing (does not link)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions