Code example for Reader

Methods: read

0
        this.reader = reader;
    } 
 
    // Note: here we may loose Unicode data. 
    public int read() throws IOException { 
        return reader.read() & 0xFF;
    } 
 
    // Note: here we may loose Unicode data. 
    public int read(byte[] b) throws IOException {
        return read(b, 0, b.length);
    } 
 
    // Note: here we may loose Unicode data. 
    public int read(byte[] b, int off, int len) throws IOException {
        char c[] = new char[len];
        int result = reader.read(c, 0, len);
        for (int i = 0; i < len; i++) {
            b[off + i] = (byte) (c[i] & 0xFF);
        } 
        return result;