code: def test_record_immediate_read(self):
      filename = os.path.join(
          self.get_temp_dir(), "record_immediate_read"
      )
      chunks_to_write = [
          "hello world{}".format(i).encode() for i in range(10)
      ]
      w = RecordWriter(open(filename, "wb"))
      r = PyRecordReader_New(filename)
      with self.assertRaises(errors.OutOfRangeError):
          r.GetNext()
      for bytes in chunks_to_write:
          w.write(bytes)
          w.flush()
          r.GetNext()
          self.assertEqual(r.record(), bytes)
      w.close()
  
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 4 for calling the RecordWriterTest obj's underlying member method code with example usage: obj.test_record_immediate_read() without return types