public final void next() throws IOException {
        //TODO check reader.ready() to get data every time is available instead
        // of force reading
        if (srcPos >= srcCount) {
//            //until read() call can block the current thread 
//            //check interruption status
//            int iTimeTowait = 1;
//            while (!reader.ready()) {
//                Thread.sleep(timeToWait++);
//            }
//            timeToWait--;  
            
            if(LOG.isTrace()) {
                LOG.trace("XmlReader.next()","will read from " + reader
                      + " srcPos: " + srcPos
                      + " srcCount: " + srcCount
                      + " srcBuf.length: " + srcBuf.length);
            }

            srcCount = reader.read(srcBuf, 0, srcBuf.length);
            
            if(LOG.isTrace()) {
                LOG.trace("XmlReader.next()","read complete, srcCount: " + srcCount );
            }
            
            if (srcCount > srcBuf.length) {
                // Oh phooey, I burned the darn' muffins!

                /* 
                   Eventum #1627, InputStreamReader.read() buggy on
                   Sony Ericsson JP 7.3 devices. Workaround: caller
                   should use a large enough buffer (chars.length AND
                   length). SEMC recommendation is 8-16 kB (4-8
                   kchars). The problem does not occur on JP 7.2 or
                   earlier or JP 7.4 or later.
                */

                throw new XmlReaderException("Input error: read more than requested bug #1627 " 
                                   + srcCount + " instead of " + srcBuf.length, this.toString());

            }

            if (srcCount <= 0) {
                throw new XmlReaderException("Input error: end not expected", this.toString());
            }
            srcPos = 1;
            c = srcBuf[0];
        } else {
            c = srcBuf[srcPos++];
        }

        //translating

        if (c == '\r') {
            wasCR = true;
            c = '\n';
        } else {
            if (wasCR) {
                wasCR = false;
                if (c == '\n')
                    next();//skip one char \r\n became \n
            }
        }
        
        //TODO: check if position calculation is correct
        if (c == '\n') {
            line++;
            column = 0;
        } else
            column++;
    } //next