| 466 | } |
| 467 | |
| 468 | void RenlibReader::fetchOneByte() |
| 469 | { |
| 470 | // move 1 byte ahead |
| 471 | for (int i = 0; i < BYTE_QUEUE_SIZE - 1; i++) |
| 472 | byteQueue[i] = byteQueue[i + 1]; |
| 473 | |
| 474 | // insert new |
| 475 | if (!in.eof()) { |
| 476 | char tmpc; |
| 477 | in.get(tmpc); |
| 478 | byteQueue[BYTE_QUEUE_SIZE - 1].ch = uint8_t(tmpc); |
| 479 | byteQueue[BYTE_QUEUE_SIZE - 1].ok = true; |
| 480 | } |
| 481 | else { |
| 482 | byteQueue[BYTE_QUEUE_SIZE - 1].ch = uint8_t(0xff); |
| 483 | byteQueue[BYTE_QUEUE_SIZE - 1].ok = false; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | uint8_t RenlibReader::popByte() |
| 488 | { |