code: def test_expect_bytes_written(self):
      filename = os.path.join(
          self.get_temp_dir(), "expect_bytes_written"
      )
      byte_len = 64
      w = RecordWriter(open(filename, "wb"))
      bytes_to_write = b"x" * byte_len
      w.write(bytes_to_write)
      w.close()
      with open(filename, "rb") as f:
          self.assertEqual(len(f.read()), (8 + 4 + byte_len + 4))
  
file_path: tensorboard/tensorboard/summary/writer/record_writer_test.py
imports: import io
  import os
  from tensorboard.summary.writer.record_writer import RecordWriter
  from tensorboard.compat.tensorflow_stub import errors
  from tensorboard.compat.tensorflow_stub.pywrap_tensorflow import PyRecordReader_New
  from tensorboard import test
label_desc: Use image node_id 1 for calling the RecordWriterTest obj's underlying member method code with example usage: obj.test_expect_bytes_written() without return types