• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Object output stream

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need your advise on serialization.
I need to send stream to my server which one is efficient

Method 1:
1. read the object
2. convert the object using xstream in to xml string
3. convert to bytes and write to servlet output stream
4. read the bytes and convert bytes to xml string
5. convert xml string back to object


Method 2:-

1. read the object
2. convert to bytes using object output stream and write to servlet output stream
4. read the bytes and convert back to object using object input stream

my question is which is efficient ?
using method 1 and method 2 ?
by looking at the steps , one could argue that method 1 having xml over head
am I right? or using object output stream is more over head ( method 2 ) ?

my result set could be (comes back from servlet) could be several thousands be records
Any help is greatly appreciated
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic