Converts an array of Unicode characters into an array of bytes in the target character encoding. This method allows a buffer by buffer conversion of a data stream. The state of the conversion is saved between calls to convert. If a call to convert results in an exception, the conversion may be continued by calling convert again with suitably modified parameters. All conversions should be finished with a call to the flush method.
@return the number of bytes written to output.
@param input array containing Unicode characters to be converted.
@param inStart begin conversion at this offset in input array.
@param inEnd stop conversion at this offset in input array (exclusive).
@param output byte array to receive conversion result.
@param outStart start writing to output array at this offset.
@param outEnd stop writing to output array at this offset (exclusive).
@exception MalformedInputException if the input buffer contains anysequence of chars that is illegal in Unicode (principally unpaired surrogates and \uFFFF or \uFFFE). After this exception is thrown, the method nextCharIndex can be called to obtain the index of the first invalid input character. The MalformedInputException can be queried for the length of the invalid input.
@exception UnknownCharacterException for any character thatthat cannot be converted to the external character encoding. Thrown only when converter is not in substitution mode.
@exception ConversionBufferFullException if output array is filled priorto converting all the input.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.