read binary data in a way compatible w/ 1.8.7