I see your point, and can understand a situation when get_bytes gets bytes from file and it is wrong to call it more than once. But anyway, as you did not specified that restriction (also performance considerations were not mentioned), my answer formally should fit...