Using JNLP, I have this line :
File_Save_Service.saveFileDialog(null,null,new StringBufferInputStream("testing"),null);
How to replace StringBufferInputStream with StringReader in this line ? The API for StringBufferInputStream says better use StringReader, but how to convert between different types ?
FileSaveService.saveFileDialog takes an InputStream, not a Reader (because it wants binary data, not character data).
StringBufferInputStream is deprecated because it does not convert characters into bytes properly.
You can use ByteArrayInputStream instead:
new ByteArrayInputStream("the string".getBytes("UTF-8"))