HI there,

do anyone know how to convert java file to midlet..?? below is my java file

client side
==================
import java.net.*;
import java.io.*;

public class tcpClient
{
public static void main(String[] args)
{
int port = 4000;
String server = "localhost";
SocketConnection conn = null;
String lineToBeSent;
InputStream input;
OutputStream output;
int ERROR = 1;

try
{
connection = (SocketConnection)Connector.open(uri, Connector.READ);
//socket = new Socket(server, port);
//System.out.println("Connected with server " + socket.getInetAddress() + ":" + socket.getPort());
}

catch (UnknownHostException e)
{
System.out.println(e); System.exit(ERROR);
}

catch (IOException e)
{
System.out.println(e); System.exit(ERROR);
}

try
{
input = new BufferedReader(new InputStreamReader(System.in));

output = new PrintWriter(socket.getOutputStream(),true);

while(true)
{
lineToBeSent = input.readLine();
//if(lineToBeSent.equals(".")) break;
output.println(lineToBeSent);
output.flush();
}
}
catch (IOException e)
{
System.out.println(e);
}

try
{
socket.close();
}

catch (IOException e)
{
System.out.println(e);
}
}
}

================================================== =
import java.net.*; // for Socket, ServerSocket, and InetAddress
import java.io.*; // for IOException and Input/OutputStream

public class TCPServer
{
private static final int BUFSIZE = 1024*20; // Size of receive buffer

public static void main(String[] args) throws IOException
{
int servPort = Integer.parseInt("4000");
// Create a server socket to accept client connection requests
ServerSocket servSock = new ServerSocket(servPort);
int recvMsgSize; // Size of received message
byte[] byteBuffer = new byte[BUFSIZE]; // Receive buffer

Socket clntSock = servSock.accept(); // Get client connection

System.out.println("Handling client at " + clntSock.getInetAddress().getHostAddress() + " on port " + clntSock.getPort());
InputStream in = clntSock.getInputStream();
OutputStream out = clntSock.getOutputStream();

try
{
for ( ; ; )
{ // Run forever, accepting and servicing connections
recvMsgSize = in.read(byteBuffer);
//System.out.println( "recvMsgSize: " + recvMsgSize );
// Receive until client closes connection, indicated by -1 return
//while( != -1 ){
//System.out.println(byteBuffer);
System.out.println( (new String(byteBuffer)).toString().trim() );
//out.write(byteBuffer, 0, recvMsgSize);
//}
}
}

catch (IOException e)
{
clntSock.close(); // Close the socket. We are done with this client!
}
}
}

================================================== ===

i oni need to covert one of the file and is Client side.. anyone know.. is urgent..