Use ptrdiff types for databuffer offset/length handling