And if you are going to enhance do it right so I suggested not to limit yourself to only read the entire file but optionally specify a buffer in case you only want a part of a (binary) file. A standard function in most other languages.