FileDocCategorySizeDatePackage
ISO8859_1_Reader.javaAPI DocphoneME MR2 API (J2ME)2478Wed May 02 17:59:54 BST 2007com.sun.cldc.i18n.j2me

ISO8859_1_Reader

public class ISO8859_1_Reader extends StreamReader
Default class reading input streams

Fields Summary
private static int
BBUF_LEN
Constructors Summary
Methods Summary
public synchronized intread()
Read a single character.

exception
IOException If an I/O error occurs

        return in.read();
    
public synchronized intread(char[] cbuf, int off, int len)
Read characters into a portion of an array.

exception
IOException If an I/O error occurs

                          
               
        int bbuflen = len;
        if (bbuflen > BBUF_LEN) {
            bbuflen = BBUF_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 intsizeOf(byte[] array, int offset, int length)
Get the size in chars of an array of bytes

        return length;