'@param fileName The path to the file to be opened. The file will be
opened with mode \'rb\'.
@param encoding If you set the optional encoding argument, then the
data will be decoded on the fly.'

def __init__(self, fileName, encoding=None):

    self.fileName = fileName
    fp = codecs.open(fileName, 'rb', encoding)
    try:
        data = fp.read()
    finally:
        fp.close()
    ANTLRStringStream.__init__(self, data)
