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();
}
}

