Do you really need a BufferedReader?
Isn’t loadStrings() & saveStrings() enough for your sketch?
https://GoToLoop.GitHub.io/processing-js.github.io/reference/loadStrings_/
https://GoToLoop.GitHub.io/processing-js.github.io/reference/saveStrings_/
B/c your Java Mode sketch would be able to run on the web if you stick w/ Processing’s API:
https://GoToLoop.GitHub.io/processing-js.github.io/reference/