setSoTimeout()
)Scanner
if you want to parse specific type of token from a stream.BufferedReader
if you want to get long strings from a streamJSONParser parser = new JSONParser();
Error : JSONParser() in JSONParser cannot be applied to expected parameters
using SimpleJSON;
using(var fs = new FileStream("file.txt", FileMode.Open, FileAccess.Read))
using (var sr = new System.IO.StreamReader(fs)){
//Read file via sr.Read(), sr.ReadLine, ...
}
}
StreamReader
and FileStream
implement IDisposable
, they will be disposed of because of the using clauses so you don't need to write a call .Close()
or .Dispose()
(As @TaW said).