File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes From Document Object to a byte array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "From Document Object to a byte array" Watch "From Document Object to a byte array" New topic
Author

From Document Object to a byte array

e vanduffel
Greenhorn

Joined: Nov 04, 2003
Posts: 12
hey guys,
i got the following issue to tackle:
I receive a xml as a byte of arrays. I manage to make a Document object
of this byte array.
Now the sending application wants a byte array back...
How do I create a byte array from Document object??

thanks,
Wout
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Is converting Document object to String to ByteArray healthy ?


Spritle Software Blogs
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Balaji Loganathan:
Is converting Document object to String to ByteArray healthy ?
Why would the String-step be needed?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
e vanduffel
Greenhorn

Joined: Nov 04, 2003
Posts: 12
Thanks for the solution...
it really works out,
but unfortunatally the client has SDK 1.3.1...
And the solution provided is not supported...

So the search continues...
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Thats make sense Lasse.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by e vanduffel:
[QB]Thanks for the solution...
it really works out,
but unfortunatally the client has SDK 1.3.1...
And the solution provided is not supported...
QB]

Is it possible for you to ship/install the latest xerces parser on the your client side ? if so the above code by Lasse will work.
e vanduffel
Greenhorn

Joined: Nov 04, 2003
Posts: 12
Can I download it some where?
greetz,
Wout
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: From Document Object to a byte array