public class CharToByteISO8859_1 extends CharToByteConverter
Constructor and Description |
---|
CharToByteISO8859_1() |
Modifier and Type | Method and Description |
---|---|
int |
convert(char[] src,
int srcStart,
int srcEnd,
byte[] dst,
int dstStart,
int dstEnd)
Converts the specified
char array into a byte array based on
this CharToByteConverter 's encoding scheme. |
int |
flush(byte[] buff,
int start,
int end)
Tells the
CharToByteConverter to convert
any unconverted data it has internally stored. |
int |
getMaxByteCount(char[] forThis,
int start,
int end)
Returns the number of bytes that the specified character
sequence will require for encoding.
|
String |
getName()
Returns the name of this encoding scheme.
|
getConverter, getDefaultConverter
public int getMaxByteCount(char[] forThis, int start, int end)
CharToByteConverter
convert()
method. The value returned may not be the actual
number of converted bytes that will be produced due to
conversion errors, but it will be the maximum that will be
produced.getMaxByteCount
in class CharToByteConverter
forThis
- contains the character sequence that will be encoded
to determine the number of bytes requiredstart
- offset into the character array to begin processingend
- ending offset in the character array to end processing.
The number of processed characters will then be (end-start)
.CharToByteConverter.convert(char[],int,int,byte[],int,int)
public int convert(char[] src, int srcStart, int srcEnd, byte[] dst, int dstStart, int dstEnd)
CharToByteConverter
char
array into a byte
array based on
this CharToByteConverter
's encoding scheme. getMaxByteCount()
should
always be called first to find out how much room is required in the
destination byte array.convert
in class CharToByteConverter
src
- the same character array passed to getMaxByteCount()
srcStart
- the same starting offset as passed to getMaxByteCount()
srcEnd
- the same ending offset as passed to getMaxByteCount()
dst
- the destination byte
arraydstStart
- offset to begin storing converted characters in the
destination arraydstEnd
- the ending location for storing converted characters into the
destination array. This argument may usually be ignored, as
the algorithm may choose to continue converting characters until
finished.CharToByteConverter.getMaxByteCount(char[],int,int)
,
CharToByteConverter.flush(byte[],int,int)
public int flush(byte[] buff, int start, int end)
CharToByteConverter
CharToByteConverter
to convert
any unconverted data it has internally stored.
Some CharToByteConverter
's will store state between
calls to convert()
. Since the converter may be left in
an unknown state, the converter should be flushed to
notify it that no more input will be received. The converter
can handle any unfinished conversions before its output is
used.flush
in class CharToByteConverter
buff
- the destination byte arraystart
- the next available offset into the destination arrayend
- offset in the destination array to stop placing data
(may be ignored by some algorithms)CharToByteConverter.convert(char[],int,int,byte[],int,int)
public String getName()
CharToByteConverter
getName
in class CharToByteConverter