code: def be_array_to_bytes(arr):
      
      data = fix_byteorder(arr)
      if hasattr(arr, 'tobytes'):
          return data.tobytes()
      else:
          return data.tostring()
docs: Writes an array to bytestring with big-endian data.