It would be good if you can structure this in a way where you aren't reading all of the bytes from each segment into an array.