use write/seek callbacks instead of writing into a buffer