|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
How do you create a Java array of bytes using CF?I'm helping a co-worker on this one. She needs to create an array of
bytes for some application she's using (the sample app was done in VB). Below is the sample VB code: Dim key() As Byte = {&H30, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H3, &H30, &H0, &H0, &H0, &H0, &H0, &H0, &H0} Is there a way to create an array of bytes in Java? I got as far as writing this code..but I failed miserably in adding an element. <cfobject action="create" type="java" class="java.util.Vector" name="JavaArray" /> <cfobject action="create" type="java" class="java.lang.Byte" name="JavaByte" /> <cfset temp = JavaByte.init('H30')> <cfset temp = JavaArray.addElement(JavaByte)> I realize ColdFusion and Java does some different data type conversions to each other...but I don't know if this is out-of-scope for CF to do. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:40:1777 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/40 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:40 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.40 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: How do you create a Java array of bytes using CF?You could always write a java class and then call that from CF.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:40:1778 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/40 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:40 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.40 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: How do you create a Java array of bytes using CF?check out Christian Cantrell's blog:
http://weblogs.macromedia.com/cantrell/archives/2004/01/byte_arrays_and.cfm Simon Horwith CIO, AboutWeb - http://www.aboutweb.com Editor-in-Chief, ColdFusion Developers Journal Member of Team Macromedia Macromedia Certified Master Instructor Blog - http://www.horwith.com Enayet Rasul wrote: >I'm helping a co-worker on this one. She needs to create an array of >bytes for some application she's using (the sample app was done in >VB). Below is the sample VB code: > >Dim key() As Byte = {&H30, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, >&H0, &H0, &H0, &H0, &H0, &H0, &H3, &H30, &H0, &H0, &H0, &H0, &H0, &H0, >&H0} > >Is there a way to create an array of bytes in Java? I got as far as >writing this code..but I failed miserably in adding an element. > ><cfobject action="create" type="java" class="java.util.Vector" >name="JavaArray" /> ><cfobject action="create" type="java" class="java.lang.Byte" name="JavaByte" /> > ><cfset temp = JavaByte.init('H30')> ><cfset temp = JavaArray.addElement(JavaByte)> > >I realize ColdFusion and Java does some different data type >conversions to each other...but I don't know if this is out-of-scope >for CF to do. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:40:1779 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/40 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:40 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.40 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: How do you create a Java array of bytes using CF?Thanks simon,
Late at nite, I stumbled on this blog posting also (which also used christian's posting to help him) and I was able to figure it out. http://tech.badpen.com/index.cfm?mode=entry&entry=19 -Enayet On 8/2/05, Simon Horwith <simon@...> wrote: > check out Christian Cantrell's blog: > http://weblogs.macromedia.com/cantrell/archives/2004/01/byte_arrays_and.cfm > > Simon Horwith > CIO, AboutWeb - http://www.aboutweb.com > Editor-in-Chief, ColdFusion Developers Journal > Member of Team Macromedia > Macromedia Certified Master Instructor > Blog - http://www.horwith.com > > > > > Enayet Rasul wrote: > > >I'm helping a co-worker on this one. She needs to create an array of > >bytes for some application she's using (the sample app was done in > >VB). Below is the sample VB code: > > > >Dim key() As Byte = {&H30, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, > >&H0, &H0, &H0, &H0, &H0, &H0, &H3, &H30, &H0, &H0, &H0, &H0, &H0, &H0, > >&H0} > > > >Is there a way to create an array of bytes in Java? I got as far as > >writing this code..but I failed miserably in adding an element. > > > ><cfobject action="create" type="java" class="java.util.Vector" > >name="JavaArray" /> > ><cfobject action="create" type="java" class="java.lang.Byte" name="JavaByte" /> > > > ><cfset temp = JavaByte.init('H30')> > ><cfset temp = JavaArray.addElement(JavaByte)> > > > >I realize ColdFusion and Java does some different data type > >conversions to each other...but I don't know if this is out-of-scope > >for CF to do. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:40:1780 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/40 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:40 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.40 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
| Free embeddable forum powered by Nabble | Forum Help |