Byte Array to String & back corruption
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();
Can anyone tell me why? I thought these last two lines were entirely
reciprocal? Thanks, Ike
.
Relevant Pages
- Re: What could be the problem with this INSERT with ADO parameters?
... The only way I have found sofar is to enclose the string in single ... written to the database. ... But that gives the same problem, it actually crashes Excel. ... how do I handle a string with comma's in the parameter array? ... (microsoft.public.data.ado) - Re: What could be the problem with this INSERT with ADO parameters?
... The only way I have found sofar is to enclose the string in single ... written to the database. ... But that gives the same problem, it actually crashes Excel. ... how do I handle a string with comma's in the parameter array? ... (microsoft.public.data.ado) - Re: Hot to parse RTF String
... Define styles in the Word document template containing the formatting ... Use VBA in Word to retrieve the strings from the database. ... automatically apply the associated style to each string as it brings it in. ... Word document, but parsed, that is formatted. ... (microsoft.public.word.docmanagement) - Re: faster way to get from SQL database into array
... string is in that list hundreds of thousands of times. ... my only problem now is that populating this array with data from my sql ... Problem - You are reading in the ENTIRE database. ... JDS Computer Training Corp. ... (comp.lang.php) - Re: faster way to get from SQL database into array
... string is in that list hundreds of thousands of times. ... my only problem now is that populating this array with data from my sql ... Problem - You are reading in the ENTIRE database. ... I don't know if it's because my SQL server and webserver are on ... (comp.lang.php) |
|