Hi Lin, If you cannot change source code of classes, then you can use *BinarySerializer* interface. You can implement it and then assign with particular class using *BinaryTypeConfiguration*.
Vladimir. On Fri, Jun 24, 2016 at 12:24 PM, Lin <[email protected]> wrote: > Hi Vladimir, > > I got it, thank you for your fast reply. There are some third party jar > files without source code, so we can't implementing the Binarylizable > interface directly. > > Thanks again. > > Lin. > > > > ------------------ Original ------------------ > *From: * "Vladimir Ozerov";<[email protected]>; > *Date: * Fri, Jun 24, 2016 05:03 PM > *To: * "user"<[email protected]>; > *Subject: * Re: Can I get a better performance on BinaryMarshaller? > > Hi Lin, > > Compact object representation was never our main goal when creating the > protocol. Our goal was to give users ability to easily work with objects > without necessity to deserialize them. > > You can make object representation more compact if you write them directly > with help of *BinaryRawWriter *class. Please try implementing > *Binarylizable* interface on *Address* and *Contact* classes. Then access > raw writer using *BinaryWriter.rawWriter()* method, and finally write all > the fields by hand. This should give you more compact result. > > Vladimir. >
