Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/05/2007, 15:03
GreenEyed
 
Fecha de Ingreso: octubre-2003
Mensajes: 3.578
Antigüedad: 20 años, 7 meses
Puntos: 51
Re: bytes de un String

De la descripción del método Byte.parseByte(String):
http://java.sun.com/j2se/1.4.2/docs/...va.lang.String)
Cita:
Parses the string argument as a signed decimal byte. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002D') to indicate a negative value. The resulting byte value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseByte(java.lang.String, int) method.
En cristiano, ese metodo es para leer un String que es un numero (p.ej. "64") y convertirlo en un byte. Así que no es lo que tu piensas.

¿Con "ocupa" te refieres a cuanto espacio en memoria? ¿O te refieres a los bytes que representan ese String? Mirando el API de String, hay un método getBytes(Encoding) que quizá te sirva.

S!

La verdad está en el API