#!/usr/bin/env python3
"""
"""

# end_pymotw_header
import io

# Writing to a buffer
output = io.BytesIO()
wrapper = io.TextIOWrapper(output, encoding="utf-8", write_through=True)
wrapper.write("This goes into the buffer. ")
wrapper.write("ÁÇÊ")

# Retrieve the value written
print(output.getvalue())

output.close()  # discard buffer memory

# Initialize a read buffer
input = io.BytesIO(
    b"Inital value for read buffer with unicode characters " + "ÁÇÊ".encode("utf-8")
)
wrapper = io.TextIOWrapper(input, encoding="utf-8")

# Read from the buffer
print(wrapper.read())

#!/usr/bin/env python3
"""
"""

# end_pymotw_header
import io

# Writing to a buffer
output = io.BytesIO()
wrapper = io.TextIOWrapper(output, encoding="utf-8", write_through=True)
wrapper.write("This goes into the buffer. ")
wrapper.write("ÁÇÊ")

# Retrieve the value written
print(output.getvalue())

output.close()  # discard buffer memory

# Initialize a read buffer
input = io.BytesIO(
    b"Inital value for read buffer with unicode characters " + "ÁÇÊ".encode("utf-8")
)
wrapper = io.TextIOWrapper(input, encoding="utf-8")

# Read from the buffer
print(wrapper.read())

#!/usr/bin/env python3 # end_pymotw_header # Writing to a buffer # Retrieve the value written # discard buffer memory # Initialize a read buffer # Read from the buffer