This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes About writeObject() and write() Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "About writeObject() and write() Methods" Watch "About writeObject() and write() Methods" New topic

About writeObject() and write() Methods

ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
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

Joined: Mar 22, 2000
Posts: 12999
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?
Have you checked out Aspose?
subject: About writeObject() and write() Methods
jQuery in Action, 3rd edition