Write and then read back binary data

http://ideone.com/HnFXv1