createJsonBytes

Serializes given object to byte array.