The code of this method is as follows:
private void parseASCII(byte bytes) throws IOException
if (bytes.length == 0)
throw new IllegalArgumentException("byte is empty");
} if (bytes.length < 2 || (bytes != '%' && bytes != '!'))
throw new IOException("Invalid start of ASCII segment");
When length is zero, it throws IllegalArgumentException, but when length is below two and its contents are not as expected, it throws IOException. It looks strange. For me, in both cases, it shall throw IOException.