ISO8859_1_Readerpublic class ISO8859_1_Reader extends StreamReader Default J2ME class for input stream readers |
Fields Summary |
---|
private static int | BBUF_LEN |
Methods Summary |
---|
public synchronized int | read()Read a single character.
return in.read();
| public synchronized int | read(char[] cbuf, int off, int len)Read characters into a portion of an array.
// Allocate a private buffer to speed up reading
int bbuflen = (len > BBUF_LEN) ? BBUF_LEN : len;
byte bbuf[] = new byte[bbuflen];
int count = 0;
while (count < len) {
int nbytes = len - count;
if (nbytes > bbuflen) nbytes = bbuflen;
nbytes = in.read(bbuf, 0, nbytes);
if (nbytes == -1) {
return (count == 0) ? -1 : count;
}
for (int i = 0; i < nbytes; i++) {
cbuf[off++] = (char)(bbuf[i] & 0xFF);
}
count += nbytes;
}
return len;
| public int | sizeOf(byte[] array, int offset, int length)Get the size in chars of an array of bytes
return length;
|
|