```java
buf.put(position, bytes);
```

Should do the trick here.