Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About writeObject() and write() Methods

 
ch praveen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
For my program, I need to pass both an object thru writeObject() method and binary data thru write() method to a servlet one after another simultaneously. Servlet is recieving object that's written thru writeObject() method which canbe collected thru readObject() method but its discarding the binary data that's been written thru write() method and I recieve nothing thru read() method. Can't we use both writeObject() and write() method simultaneously. Kindly post your suggestions.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the same output stream as an ObjectOutputStream to writeObject and to then write a block of binary data to the same stream sounds pretty tricky. Why don't you make the binary data a byte[] and send it with writeObject?
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic