java - POJOs to byte array vs POJOs to json -
i'm newbie @ java. i'm confusing serialization , deserialization. so, i'm confusing 1 should use.
i'm looking round , found boon, jackson, gson (i'm using gson, of article using jackson , boon) json serialization. , serialize object byte array or binary object.
just, 1 faster , 1 should chose?
i'm make simple application, saving current state, document , other thing.
thanks in advance :)
serialize data means convert them sequence of bytes.
this sequence can interpreted sequence of readable chars happens in json, xml, yaml , on.
the same sequence can sequence of binary data not human readable.
there pro , cons each serialization approach.
pro of human readable:
- many existing libraries serialize deserialize data
- the data can debugged
- many existing libraries , apis use solution
cons:
- many bytes needed
- serialization , deserialization process can difficult , time machine consuming
pro , cons of binary data:
pro:
- faster serialization deserialization process
- less data transfer on network
cons:
- difficult read data passed on network
- not 1 representation of same data (bigendian or not example)
Comments
Post a Comment