com.novell.io
Class UTF8Encoder
java.lang.Object
com.novell.io.CharEncoder
com.novell.io.UTF8Encoder
- public class UTF8Encoder
- extends CharEncoder
This class implements UTF-8 character encoding
for use by the EncodingStreamWriter class
Field Summary |
static String |
NAME
Name of encoding that this encoder implements. |
Method Summary |
int |
encodeChar(int c,
byte[] buffer,
int off)
Implementation of UTF-8 character encoding |
String |
getEncoding()
Return the string identifier for this encoding scheme. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final String NAME
- Name of encoding that this encoder implements.
- See Also:
- Constant Field Values
UTF8Encoder
public UTF8Encoder()
encodeChar
public int encodeChar(int c,
byte[] buffer,
int off)
throws CharEncodingException,
EncodingBufferFullException
- Implementation of UTF-8 character encoding
- Specified by:
encodeChar
in class CharEncoder
- Parameters:
c
- The 32-bit character value to encodebuffer
- The byte buffer in which to placed encoded bytesoff
- The offset at which to place bytes into the buffer
- Returns:
- The number of bytes placed in the buffer
- Throws:
CharEncodingException
- The character could not be encoded
in the implemented encoding scheme.
EncodingBufferFullException
- There is not enough room in buffer
for all the bytes needed to encode the character.
getEncoding
public String getEncoding()
- Return the string identifier for this encoding scheme.
- Specified by:
getEncoding
in class CharEncoder
- Returns:
- The string identifier for this encoding scheme.