public int Read() { if (bufPos < bufLen) { return buf[bufPos++] & 0xff; // mask out sign bits } else if (getPos() < fileLen) { setPos(getPos()); // shift buffer start to pos return buf[bufPos++] & 0xff; // mask out sign bits } else if (stream != null && ReadNextStreamChunk() > 0) { return buf[bufPos++] & 0xff; // mask out sign bits } else { return EOF; } }
public int Read() { if (bufPos < bufLen) { return buf[bufPos++] & 0xff; // mask out sign bits } else if (getPos() < fileLen) { setPos(getPos()); // shift buffer start to pos return buf[bufPos++] & 0xff; // mask out sign bits } else if (stream != null && ReadNextStreamChunk() > 0) { return buf[bufPos++] & 0xff; // mask out sign bits } else { return EOF; } }
public int Peek() { int curPos = getPos(); int ch = Read(); setPos(curPos); return ch; }
public int Peek() { int curPos = getPos(); int ch = Read(); setPos(curPos); return ch; }
void NextCh() { if (oldEols > 0) { ch = EOL; oldEols--; } else { pos = buffer.getPos(); // buffer reads unicode chars, if UTF8 has been detected ch = buffer.Read(); col++; charPos++; // replace isolated '\r' by '\n' in order to make // eol handling uniform across Windows, Unix and Mac if (ch == '\r' && buffer.Peek() != '\n') ch = EOL; if (ch == EOL) { line++; col = 0; } } }
void NextCh() { if (oldEols > 0) { ch = EOL; oldEols--; } else { pos = buffer.getPos(); // buffer reads unicode chars, if UTF8 has been detected ch = buffer.Read(); col++; charPos++; // replace isolated '\r' by '\n' in order to make // eol handling uniform across Windows, Unix and Mac if (ch == '\r' && buffer.Peek() != '\n') ch = EOL; if (ch == EOL) { line++; col = 0; } } }