com.novell.io
Class ISO8859Encoder
java.lang.Object
com.novell.io.CharEncoder
com.novell.io.ISO8859Encoder
- Direct Known Subclasses:
- ISO885914Encoder, ISO885915Encoder, ISO88592Encoder, ISO88593Encoder, ISO88594Encoder, ISO88595Encoder, ISO88596Encoder, ISO88597Encoder, ISO88598Encoder, ISO88599Encoder
- public abstract class ISO8859Encoder
- extends CharEncoder
Base class for ISO-8859-* encoders
Constructor Summary |
protected |
ISO8859Encoder(char[] table)
Allow specific ISO-8859-* encoder implementations
to supply their encoder table |
Method Summary |
int |
encodeChar(int c,
byte[] buffer,
int off)
Implementation of character encoding |
int |
encodeChars(char[] chars,
int off,
int len,
byte[] buffer,
int outputIndex)
Encode some number of characters into bytes in a buffer.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAP_SIZE
public static final int MAP_SIZE
- See Also:
- Constant Field Values
ISO8859Encoder
protected ISO8859Encoder(char[] table)
- Allow specific ISO-8859-* encoder implementations
to supply their encoder table
- Parameters:
table
- The encoder table for chars 0x0A-0xFF
encodeChars
public int encodeChars(char[] chars,
int off,
int len,
byte[] buffer,
int outputIndex)
throws CharEncodingException,
EncodingBufferFullException
- Encode some number of characters into bytes in a buffer.
Derived classes may want to override this for better performance.
- Overrides:
encodeChars
in class CharEncoder
- Parameters:
chars
- The array of characters to convertoff
- The offset into the array of the first character to convertlen
- The number of characters to convertbuffer
- The byte array in which to store the encoded bytesoutputIndex
- The offset into buffer at which to store the encoded bytes
- Returns:
- The number of bytes stored in the buffer
- Throws:
CharEncodingException
- If a character could not be encoded
CharEncoderBufferFull
- If the passed buffer is too small
EncodingBufferFullException
encodeChar
public int encodeChar(int c,
byte[] buffer,
int off)
throws CharEncodingException,
EncodingBufferFullException
- Implementation of 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.