Buffer or DataInput overflow bug fix + ASCII aware performance improvement for issue #3483