Files
mercury/tests/hard_coded/putback_binary_uint8.exp
Julien Fischer 6e91909412 Putback of 8-bit values to binary input streams.
Support direct putback of int8 and uint8 values to binary input streams
instead of via the bottom 8 bits of an int value.

library/io.m:
    Add putback_{int8,uint8}/[34].

    Add stream type class instances for putback streams binary_input_stream
    with int8 and uint8.

tests/hard_coded/Mmakefile:
tests/hard_coded/putback_binary_int8.{m,exp}:
tests/hard_coded/putback_binary_uint8.{m,exp}:
    Add tests of the above.
2018-10-05 06:42:30 +00:00

33 lines
259 B
Plaintext

Position: 0
Read: 97u8
Position: 1
Seek: +1
Position: 2
Read: 99u8
Position: 3
Put back: 128u8
Position: 2
Read: 128u8
Position: 3
Read: 10u8
Position: 4
Read: eof
Position: 4
Put back: 255u8
Position: 3
Seek: -2
Position: 1
Read: 98u8
Position: 2