String type = c.getType();
System.out.println("type : " + type);
DataInputStream dis = new DataInputStream(is);
int length = dis.available();
byte [] reponseBytes = new byte[length];
dis.read(reponseBytes);
System.out.println("Received . :" + new String(reponseBytes));
} finally {
if (is != null)
is.close();
if (os != null)
os.close();
if (c != null)
c.close();
}
}
}
import javax.microedition.midlet.*;
public class Main extends MIDlet {
public Main() {
}
protected void pauseApp() {
/**@todo Implement this javax.microedition.midlet.MIDlet abstract method*/
}
protected void startApp() throws javax.microedition.midlet.MIDletStateChangeException {
/**@todo Implement this javax.microedition.midlet.MIDlet abstract method*/
new Http("http://127.0.0.1:8080/examples/servlet/HttpGameServer");
}
protected void destroyApp(boolean parm1) throws javax.microedition.midlet.MIDletStateChangeException {
/**@todo Implement this javax.microedition.midlet.MIDlet abstract method*/
}
}