code: def _read_record(self, stream):
          
          header = stream.read(4)
          if len(header) < 4:
              return None
          size, rec_type = struct.unpack('>HH', header)
          data_type = (rec_type & 0x00ff)
          rec_type = rec_type // 256
          data = None
          if size > 4:
              if data_type == 0x01:
                  data = numpy.array(
                      struct.unpack('>{0}H'.format((size - 4) // 2),
                                    stream.read(size - 4)),
                      dtype='uint')
              elif data_type == 0x02:
                  data = numpy.array(
                      struct.unpack('>{0}h'.format((size - 4) // 2),
                                    stream.read(size - 4)),
                      dtype='int')
              elif data_type == 0x03:
                  data = numpy.array(
                      struct.unpack('>{0}l'.format((size - 4) // 4),
                                    stream.read(size - 4)),
                      dtype='int')
              elif data_type == 0x05:
                  data = numpy.array([
                      _eight_byte_real_to_float(stream.read(8))
                      for _ in range((size - 4) // 8)
                  ])
              else:
                  data = stream.read(size - 4)
                  if str is not bytes:
                      if data[-1] == 0:
                          data = data[:-1].decode('ascii')
                      else:
                          data = data.decode('ascii')
                  elif data[-1] == '\0':
                      data = data[:-1]
          return [rec_type, data]
docs: Read a complete record from a GDSII stream file.
  
          Parameters
          ----------
          stream : file
              GDSII stream file to be imported.
  
          Returns
          -------
          out : 2-tuple
              Record type and data (as a numpy.array)