def __init__(self, path, encoding="utf-8", chunk_size=io.DEFAULT_BUFFER_SIZE):
        """Constructor for FileReadBackwards.

        Args:
            path: Path to the file to be read
            encoding (str): Encoding
            chunk_size (int): How many bytes to read at a time
        """
        if encoding.lower() not in supported_encodings:
            error_message = "{0} encoding was not supported/tested.".format(encoding)
            error_message += "Supported encodings are '{0}'".format(",".join(supported_encodings))
            raise NotImplementedError(error_message)

        self.path = path
        self.encoding = encoding.lower()
        self.chunk_size = chunk_size
        self.iterator = FileReadBackwardsIterator(io.open(self.path, mode="rb"), self.encoding, self.chunk_size)
def __init__ ( self , path , encoding = "utf-8" , chunk_size = io . DEFAULT_BUFFER_SIZE ) : if encoding . lower ( ) not in supported_encodings : error_message = "{0} encoding was not supported/tested." . format ( encoding ) error_message += "Supported encodings are '{0}'" . format ( "," . join ( supported_encodings ) ) raise NotImplementedError ( error_message ) self . path = path self . encoding = encoding . lower ( ) self . chunk_size = chunk_size self . iterator = FileReadBackwardsIterator ( io . open ( self . path , mode = "rb" ) , self . encoding , self . chunk_size )
Constructor for FileReadBackwards.

        Args:
            path: Path to the file to be read
            encoding (str): Encoding
            chunk_size (int): How many bytes to read at a time