commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Re: [httpclient] Sending serialized object from httpclient to servlet.
Date Tue, 08 Feb 2005 20:04:43 GMT
From: "Sanjeev Tripathi" <>
> I know how to serialize object to file or socket. But How I can
> convert object to bytes so I can use
> byte[] encodedData = Base64.encodeBase64( binaryData );

If you know how to serialize an object to a file, then you know about
OutputStreams-- probably FileOutputStream.  There is also a

     bos = new ByteArrayOutputStream();
     out = new ObjectOutputStream(bos);
     byte[] binaryData = bos.toByteArray();

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message