/** Trigger an encoding error to be delivered to any registered EncodingErrorHandler. * There is one sort of error that can only be detected from the * outside of this class, namely an incomplete input sequence but no * further input available. For this reason this method has been * given public access to allow an error report to be triggered * externally * @param errortype A String reprenting the type of the error that has occurred. * This string will be passed on via the EncodingErrorHandler interface.*/ public void handleEncodingError(String errortype) { if (errorhandler != null) { int max_sequence_available = inbufferlimit - inbufferpos; // do not surprise our clients by returning pointers to nonexistent bytes // should the error be invoked by DirectInputStreamReader as a result of // incomplete final sequence. if (max_sequence_available > input_sequence_length) max_sequence_available = input_sequence_length; errorhandler.reportEncodingError (errortype, linenumber, totalbytesin, inbuffer, inbufferpos, max_sequence_available); } }