I have the below code which do serialisation and save the output in the file, so this file can be used by other application
private ByteArrayOutputStream baos