I have no idea how to write a byteArray like this in CF
b = new byte[] { 0x5e, 0x31, 0x9b, 0xdb, 60, 0x5b };
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Binary objects in ColdFusion are Byte Arrays. Here is an example:
This outputs:
edit
I discovered something unpleasant about ColdFusion in answering this… namely, that CF apparently treats all numbers as signed, and so refuses to cast a value over 127 into a byte field. In order to get a value over 127 (such as, in your example, 0x9b/155), you have to cast it as unsigned. Unfortunately, this is not that easy to do. However, I’ve whipped up a little function which makes it easier: