New binary copy method

Based on https://gist.github.com/osima/1167161