I have to say I don't understand why you create a (correct) Reader over the properties file, then create a String from that, then convert that String back to an array of bytes, then create a second Reader over that array of bytes. Why can't ANTLR just be given the first Reader?
Because, first of all the reading of file is in existing framework, the output content is being used by different clients. So, I don't have much control on that. The file reading is part of the framework and the antlr job is part of a client.
Secondly, I could have directly pass the content to the AntlrInputstream like this:
And that was what I was doing. Later I thought of identifying the character encoding from the input stream and so I have used the reader.
But... but, one mysterious thing, just today morning when I again tried the code from command line, there are no more ANTLR token recognition error. I really don't know how it get solved, but for now, it's working fine.