Hai Friends, i want read the string from server and to write in bytes to openOutputStream.
Example :
byte bytestr[]={0x1D,0x28,0x4C,0x87,0x02,0x30,0x43};
StreamConnection con =(StreamConnection)Connector.open(serverConnectionString);
os = con.openOutputStream();

i want to read bytestr from server as string using httpconnection, and to convert to byte array,how can i implement this.
please help me for this problem.

Download source code for chapter 18 of Jonathan Knudsen book Kicking Butt with MIDP and MSA. It is the best example which you get. Have look at the code and if you have problem to figure out how does it work then let me know...