Convert chunks to Buffer to use copy

The chunk argument can be either a String or a Buffer. In the case of node-replay, a String is passed. In order to use the copy function the String must be converted to a Buffer.