dcsimg
How to convert a Primitive Wrappter Array to primitive Array
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anjan_Bacchu
Posted On:   Tuesday, July 12, 2005 04:59 PM

Hi All,



thanks for any pointers.



A method needs to return a long [] from a DB/SQL query. Inside the method, we create an ArrayList . Now what is an easy way to convert this ArrayList to a "long []" ?



I could NOT find anything in jakarta commons/ClassUtils ?



Thanks for any pointers ?



BR,

~A

Re: How to convert a Primitive Wrappter Array to primitive Array

Posted By:   Stephen_Smith  
Posted On:   Wednesday, July 27, 2005 08:53 AM

There doesn't seem to be much in Jakarta Commons to support this requirement ATM, so the quickest solution may well be to use an Enhanced For Loop yourself.


In addition, I'd suggest writing some reusable 1.4-compliant code to convert a Collection of wrapper Objects into their associated primitive types, and then submitting it to Commons Collections.

About | Sitemap | Contact