from io import BytesIO

if __name__ == '__main__':
    f = BytesIO()
    f.write("你好呀".encode("utf-8"))
    print(f.getvalue())

    f2 = BytesIO(b'\xe4\xb8\xad\xe6\x96\x87')
    print(f2.read().decode("utf-8"))
16f70a691806a0e8c019c9eef74aa3c440a8dd71
<mask token>

<mask token>
if __name__ == '__main__':
    f = BytesIO()
    f.write('你好呀'.encode('utf-8'))
    print(f.getvalue())
    f2 = BytesIO(b'\xe4\xb8\xad\xe6\x96\x87')
    print(f2.read().decode('utf-8'))

from io import BytesIO
if __name__ == '__main__':
    f = BytesIO()
    f.write('你好呀'.encode('utf-8'))
    print(f.getvalue())
    f2 = BytesIO(b'\xe4\xb8\xad\xe6\x96\x87')
    print(f2.read().decode('utf-8'))

from io import BytesIO

if __name__ == '__main__':
    f = BytesIO()
    f.write("你好呀".encode("utf-8"))
    print(f.getvalue())

    f2 = BytesIO(b'\xe4\xb8\xad\xe6\x96\x87')
    print(f2.read().decode("utf-8"))