replace fread with read

When the size to fread is small, fread uses memcpy internaly.
Use instead read to avoid it.