code: public static byte[] serialize(Object value) throws IOException {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      serialize(value, out);
      return out.toByteArray();
    }
docs: Serializes the given object value to a newly allocated byte array.
  
  @param value object value to serialize
  @since 1.16