docs: @JSFunction
      public void close() throws IOException {
          if (reader != null) {
              reader.close();
              reader = null;
          } else if (writer != null) {
              writer.close();
              writer = null;
          }
      }