String receivString(DataInputStream in) {
String inline="";
int len=0;
try{
inline=in.readLine();
for(int i=0;inline.equals("");i++){inline=in.readLine();Thread.sleep(100);if(i==300)return "";}
len=new Integer(inline).intValue();
}catch(Exception e){System.out.println(" receivString() error:"+e);}
char c[]=new char[len];
byte buf[]=new byte[len*2];
try{in.readFully(buf);}
catch(IOException e){System.out.println(" receivString() error:"+e);}
for(int i=0;i {c[i]=(char)(buf[i*2]<<8);c[i]=(char)((c[i]&0xff00)|(0x00ff&buf[i*2+1]));}
String s=null;
s=new String(c);