Fix bug 8280 in CustomInputStream.