It now takes offsets relative to the buffer's head. It's up to the callers to add this offset which corresponds to the buffer's output size.