I am working on some project which deals with HTML pages.
I don’t want to download the same page over and over again, so I want to save it locally.
I use the Scanner a lot, however the Scanner need a InputStreamReader.
For now I managed to save the HTML page to a local StringBuffer, however I can’t make
this StringBuffer be used with the Scanner.
Can I make this StringBuffer be used as an InputStreamReader? If not, then what method can I use?
Scannerhas a constructor taking aReadable. Of allReadableimplementations, theCharBufferseems to suit your purpose the most since you want to have a readable and writeable source.