title: How to convert Object to bytearray (any object to List<int>)
body: <p>How to convert Object to List (array bytes)
  I have instance (some object) from class MyClass and I want to get bytes from this object. How implement this?</p>
  <p>Code:</p>
  <pre><code>class MyClass {}
  
  var myClass = MyClass()
  
  List&lt;int&gt; getBytesFromObject(Object object) {
      // ??? what here should be ???
  }
  
  // so I can use it like:
  List&lt;int&gt; bytes = getBytesFromObject(myClass)
  </code></pre>