Hi everyone,
How do we convert a Non-serializable object to a byte array?
I do know, if the object is serializable, then we can use ObjectOutputStream and ByteArrayOutputStream to write an object and execute the bytearray() method to get the bytes.
But, in case of Non-serializable objects, how do we obtain the object in the form of a byte array?
Note: From
String object we can obtain bytes, but I do not want to convert the Object to String.
Object obj = new Object();
obj.??
Any help will be appreciated.
Thanks.