Ike wrote:
> I have an MS Word document, as a BLOB in a database.
>
> byte [] jack = ..//an MS WORD Document, read into a byte array
>
> //When I retrieve it from the DB, as a byte [], and write it to disk, the
> file is fine.
> //However, if I convert the byte array, to string, then back to byte array,
> //it will now be unreadable from from Word if I write it to disk
>
> String tempstring=new String(jack);
> jack=tempstring.getBytes();
Did you make sure that you are getting and setting the right encoding?
IOW,
byte[] myBytes = tempstring.getBytes("UTF-8");
String myString = new String(myBytes, "UTF-8");
Just a thought
|