add more debug
add ensureCodedBufferSize