encounter errors in java

hi guys .i have encounter some errors during compiling and could nt solve it .pls help me

errors:

symbol : method readBytes()

location: class java.io.DataInputStream

dataIn = is.readBytes();

^

-

symbol : method write(java.lang.String)

location: class java.io.DataOutputStream

os.write(dataOut);

^

i'm pasting some of the codes here

pls help.thanks in advance

i have imported

java.io and microedition.io

privatevoid socketMessage(){

StringBuffer sb =new StringBuffer("");

String dataIn =null;

String dataOut =null;

int c = 0;

try{

StreamConnection connection = (StreamConnection)Connector.open("socket://localhost:5678", Connector.READ_WRITE);

DataOutputStream os = connection.openDataOutputStream();

DataInputStream is = connection.openDataInputStream();

connection.close();

try{

dataOut = txtField.getString();

os.write(dataOut);

os.flush();

dataIn = is.readBytes();

System.out.println(dataIn);

}finally{

is.close();

os.close();

}

}catch (IOException x){

System.out.println("Problems sending or receiving data.");

x.printStackTrace();

}

}

[1975 byte] By [kenneth-rocka] at [2007-11-26 23:36:47]
# 1
Kindly have a look at the MIDP API documentation.I reckon DataInputStream object does not have readBytes() method.~Mohan
itsmohana at 2007-7-11 14:59:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...