Changed binary writer a little to allow for buffered (and faster) writing