Re: Storing byte[] array
Re: Storing byte[] array
- Subject: Re: Storing byte[] array
- From: Zak Burke <email@hidden>
- Date: Sat, 26 Mar 2005 18:34:57 -0500
Drew Thoeni wrote on 3/26/05 5:27 PM:
[...]
The PBEKeySpec pbeCipher.doFinal() generates a byte[] array, each byte
being a hex value. In any attempt I have made in storing this to the
database, WO converts it to a string and gets very unpredictable results
due to the conversion to non-printable characters.
How is this normally done so it can be store and, importantly, retrieved
in a form that can be converted back?
This class by arenared:
http://www.bombaydigital.com/software/misc/HexString.java
described in this post:
http://www.bombaydigital.com/arenared/2004/2/12/1
has methods that convert between Hex strings, byte arrays and plain old
strings, the last being storable in a simple varchar field in a DB.
There are static methods for each of several conversions, and all are
very well documented.
zak.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden