Hi Michael, You can look at the source code for java.lang.Long.parseLong() (and Integer.parseInt) to get some ideas how it could be done. They don't use ByteBuffers but the alogorithm would probably be easy to rewrite for use in that context -- maybe.
The Javolution library also claims to have very efficient parsing of strings to primitive types. I haven't looked at the code but that could also be a resource. http://javolution.org/ Regards, Steve > -----Original Message----- > From: Michael Bauroth [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 13, 2006 9:20 AM > To: [email protected] > Subject: converting ASCII represented longs from ByteBuffer > to simple data type? > > Hi, > > has somebody a short code snippet, how I can convert an ASCII > span, which represents a long (e.g. 1234) from ByteBuffer to > the simple java type long most efficiently (minimum of new > object generation / buffer copies ...) > > Reagrds > Michael >
