Throw a custom exception not IOException when max length exceeded