length()
Returns the length of the String, in characters. (Note that this doesn't include a trailing null character.)
Since the length excludes the terminating null byte, your array is one element too short. Since getBytes() is smart enough to truncate the string if necessary to fit in the buffer you supply, and to null-terminate it even if it was truncated, what you're seeing is the string minus the last character.