Explain how to convert any java object into byte array.



Explain how to convert any java object into byte array...

Answer / Puja Rastogi

{"conversion": [n "ObjectOutputStream oos = new ObjectOutputStream(new ByteArrayOutputStream()); oos.writeObject(object); byte[] bytes = oos.toByteArray();"n]}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

1 Answers  


Explain the concept of polymorphism with examples?

6 Answers   Summation Tech,


In treeset we add same object ...what will be the out put

3 Answers  


What is object-oriented programming?

1 Answers  


What is the Concept of Encapsulation in OOPS

1 Answers   HCL,


primitive data types in Java ?

3 Answers  


When can you say a graph to be a tree?

1 Answers   Amazon,


Give few difference between constructor and method?

1 Answers  


In what types of operations an ArithmeticException will be thrown?

3 Answers  


Difference between Array and vector?

9 Answers  


Are variables stored in ram?

1 Answers  


Which sorting is used in arrays sort in java?

1 Answers  


Categories