Oh yeah, you are right.  Sorry.  I should've thought more about it.  What you have to do is

```java
ByteBuffer copy = buf.duplicate();
copy.position(position);
copy.put(bytes);
```

Basically, duplicate just copies the pointers without copying the contents of the ByteBuffer, so it gives you a new object with the same backing structure, but with its own position, limit, mark, etc.

You then set the position to where you want to start writing on the copy and then you put the bytes[] in with the mutating put.  The mutation all happens on the copy so the original object is unaffected.