Retroceder   Foros del Web > Programación para sitios web > Java y JSP

Respuesta
 
Herramientas Desplegado
Antiguo 20-may-2004, 08:39   #1 (permalink)
kittya está en el buen camino
 
Avatar de kittya
 
Fecha de Ingreso: abril-2004
Mensajes: 260
Enviar un mensaje por MSN a kittya
j2me y jre

hola a todos tengo el siguiente problema me guataria que me ayudaran

tengo un programa hecho en java normal que le bytes y doubles y lo hace bien lee 1 , 0 y todo bien

y tengo otro en J2ME que no esotro sino el mis mo pero aqui no funciona igual aunque es el mismo codigo aqui me lee 86 -64 etc, cuando solo me puede leer 1 o 0 dependiendo de los estados


aqui esta el codigo del primero:

private InputStream DataIn;
private ByteArrayOutputStream CommandData;
private DataInputStream Status;
private byte StatusData[] = new byte[1024];

constructor

CommandData = new ByteArrayOutputStream();
Command = new DataOutputStream(CommandData);
LSocket = new Socket(InetAddress.getByName(IPAddress),IPPort);
DataOut = LSocket.getOutputStream();
DataIn = LSocket.getInputStream();

double d=Status.readDouble(); // aqui leeo algo bien


este es el codigo del de J2ME+

private byte StatusData[] = new byte[1024];
private DataInputStream Status;
private ByteArrayOutputStream CommandData;
InputStream is;

CONSTRUCTOR
Status = new DataInputStream(new ByteArrayInputStream(StatusData));
sc = (StreamConnection) Connector.open(socket://"+ip+":13000");

os = sc.openOutputStream();
DataIn = sc.openInputStream();

if(DataIn.read(StatusData,0,StatusData.length) > 0) {
byte y= JniorStatus.readByte(); // Aqui leo pero me pero salen numeros que no


podrian decirme cual seria el error porque no funciona igual
kittya está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Desactivado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 14:23.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93