Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ByteArrayOutputStream posing problem while serializing

843833Nov 20 2008 — edited Nov 20 2008
Hi All,
I'm trying to serialize the object using XMLEncoder with ByteArrayOutputStream (BAOS) as the OutputStream. The serialization was successful and there are no Exception. But when i try to convert the BAOS to String using BAOS.toString(), only partial data has been retrived. The String ends with "...". When I tried the same with FileOutputStream it works fine. Coz, I dont want to use FileOutputStream.
I need to store the object in the database.

Any help is highly Appreciated.

In case if there are any best pratice to save the object to db is available, Please share!

Note: I see the BAOS is initalized with 1KB of memory and the String variable 12KB of data.

Thanks,
invalidParameter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2008
Added on Nov 20 2008
16 comments
372 views