01: package uk.org.ponder.stringutil;
02:
03: /** This is an interface used by the advanced InputStreamReader architecture
04: * (uk.org.ponder.streamutil.DirectInputStreamReader and ByteToCharUTF8) to
05: * allow far more authoritative and precise reporting of errors encountered
06: * while converting byte-encoded data back into characters.
07: */
08:
09: public interface EncodingErrorHandler {
10: /** Called by the decoder when an error is encountered in the byte data.
11: * @param errortype A string representing the type of the encountered error.
12: * @param linenumber A line number (perhaps formed by counting \n) for the
13: * encountered error.
14: * @param byteoffset The byte offset of the data that is in error, within the
15: * entire data to be converted.
16: * @param sourcearray An array of bytes in which the erroneous input characters
17: * may be inspected.
18: * @param errorpos An offset within <code>sourcearray</code> of the erroneous bytes.
19: * @param errorlength As best as can be determined, the length in bytes of the
20: * error data.
21: */
22: public void reportEncodingError(String errortype, int linenumber,
23: int byteoffset, byte[] sourcearray, int errorpos,
24: int errorlength);
25: }
|