• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Storing byte[] array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Storing byte[] array (From: Drew Thoeni <email@hidden>)

  • Prev by Date: Re: Storing byte[] array
  • Next by Date: Re(2): Killer Application
  • Previous by thread: Re: Storing byte[] array
  • Next by thread: An EOEditingContext Problem
  • Index(es):
    • Date
    • Thread