what would be the equivalent of this code:
FileReader reader = null;
try
{
reader = new FileReader( file);
return reader.ready();
}
catch( IOException ex)
{
return false;
}
For SmbFile
? I tried that:
BufferedReader reader = null;
try
{
SmbFileInputStream fstream = new SmbFileInputStream( file);
reader = new BufferedReader( new InputStreamReader( fstream));
return reader.ready();
}
catch( IOException ex)
{
return false;
}
but then I always get "false" as result.
Based on the documentation looks that there's no guarantee that this flag assure it cannot be read, Note that returning false does not guarantee that the next read will block.
You can try this way to avoid null values,
You can look at this post too, bufferedreader-not-stating-ready-when-it-should
Hope this helps