| java.lang.Object sun.io.ByteToCharConverter sun.io.ByteToCharISO8859_1
ByteToCharISO8859_1 | public class ByteToCharISO8859_1 extends ByteToCharConverter (Code) | | A algorithmic conversion from ISO 8859-1 to Unicode
author: Lloyd Honomichl author: Asmus Freytag |
Method Summary | |
native public int | convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd) | public int | flush(char[] output, int outStart, int outEnd) | public String | getCharacterEncoding() | public void | reset() This is the old Java version convert(). |
convert | native public int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd) throws ConversionBufferFullException(Code) | | Algorithmic character conversion
|
flush | public int flush(char[] output, int outStart, int outEnd)(Code) | | |
getCharacterEncoding | public String getCharacterEncoding()(Code) | | |
reset | public void reset()(Code) | | This is the old Java version convert(). We changed it
to a CNI method for performance purpose.
public int convert(byte[] input, int inOff, int inEnd,
char[] output, int outOff, int outEnd)
throws ConversionBufferFullException
{
int bound = inOff + (outEnd - outOff);
if (bound >= inEnd) {
bound = inEnd;
}
int bytesWritten = inEnd - inOff;
// Loop until we hit the end of the input
try {
while(inOff < bound) {
output[outOff++] = (char) (0xff & input[inOff++]);
}
} finally {
charOff = outOff;
byteOff = inOff;
}
// If we don't have room for the output, throw an exception
if (bound < inEnd)
throw new ConversionBufferFullException();
// Return the length written to the output buffer
return bytesWritten;
}
|
Methods inherited from sun.io.ByteToCharConverter | abstract public int convert(byte[] input, int inStart, int inEnd, char[] output, int outStart, int outEnd) throws MalformedInputException, UnknownCharacterException, ConversionBufferFullException(Code)(Java Doc) public char[] convertAll(byte input) throws MalformedInputException(Code)(Java Doc) abstract public int flush(char[] output, int outStart, int outEnd) throws MalformedInputException, ConversionBufferFullException(Code)(Java Doc) public int getBadInputLength()(Code)(Java Doc) abstract public String getCharacterEncoding()(Code)(Java Doc) public static ByteToCharConverter getConverter(String encoding) throws UnsupportedEncodingException(Code)(Java Doc) public static ByteToCharConverter getDefault()(Code)(Java Doc) public int getMaxCharsPerByte()(Code)(Java Doc) public int nextByteIndex()(Code)(Java Doc) public int nextCharIndex()(Code)(Java Doc) abstract public void reset()(Code)(Java Doc) public void setSubstitutionChars(char[] c) throws IllegalArgumentException(Code)(Java Doc) public void setSubstitutionMode(boolean doSub)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|