0
4

2 回答 2

5

You need to encode the byte array into a Base64 string, then decode it back to a byte array when you read it from the database. Note that the encoded string will be around 33% larger than the original byte array.

于 2013-04-26T21:40:00.013 回答
1

If you'll always consume your key as a byte[] in your application it would be far better to save it as a BLOB binary object itself in the database. You'll save yourself from conversion errors.

于 2013-04-26T21:48:34.683 回答