public static byte[] getAsBytes(Object event) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(event);
        return baos.toByteArray();
    }
Contains utility methods for the error handler.
modules/siddhi-core/src/main/java/io/siddhi/core/util/error/handler/util/ErrorHandlerUtils.java