2016-05-02 12:15:11 +01:00
|
|
|
import uio as io
|
2016-03-25 13:01:19 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
io.BytesIO
|
|
|
|
io.BufferedWriter
|
|
|
|
except AttributeError:
|
|
|
|
import sys
|
|
|
|
print('SKIP')
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
bts = io.BytesIO()
|
|
|
|
buf = io.BufferedWriter(bts, 8)
|
|
|
|
|
|
|
|
buf.write(b"foobar")
|
|
|
|
print(bts.getvalue())
|
|
|
|
buf.write(b"foobar")
|
|
|
|
# CPython has different flushing policy, so value below is different
|
|
|
|
print(bts.getvalue())
|
|
|
|
buf.flush()
|
|
|
|
print(bts.getvalue())
|
|
|
|
buf.flush()
|
|
|
|
print(bts.getvalue())
|