So, basically, I have a 256MB file which contains "int32" numbers written as 4-byte sequences, and I have to sort them into another file.

The thing I struggle with the most is how I read the file into an array of 4-byte sequences. First I thought this method is slow because it reads elements one by one:

```
for i in range(numsPerFile):
    buffer = currFile.read(4)
    arr.append(buffer)

```

Then I made this:

```
buffer = currFile.read()
arr4 = []
for i in range(numsPerFile):
    arr4.append(bytes(buffer[i*4 : i*4+4]))

```

And it wasn't any better when I measured the time (both read 128000 numbers in ~0.8 sec on my pc). So, is there a faster method to do this?