Read file in chunks to increase speed

Reading a file bytewise can be very slow on some systems. To
avoid this the file is now read in blocks of 8KiB size.
Use correct indentation