I have 3rd party library function which only takes Reader as parameter. And I have String that I need to pass into function. How do I do that ?
String s = "Some String";
StringReader sReader = new StringReader(s);
// 3rd Party Function Definition is public File saveResult(Reader source);
Can I do as File aFile = saveResult(sReader); ? Or Should I create buffer and call read() first ?
I tried both way, and I am keep getting null pointer exception.