finally this will work :) use buffReader.ready() method to check if there is something in the stream..........
while( true ) { char[] charArray1 = new char[10]; buffReader.read( charArray1 , 0 ,10 ); String length = new String( charArray1 ); int lengthInt = 0; try{ lengthInt = new Integer( length ).intValue(); System.out.println("length is " + lengthInt ) // just add another 10 to lengthInt lenghtInt = lenghtInt + 10; } catch( Exception e) { System.out.println(" Error " + e ); e.printStackTrace(); } char[] charArray2 = new char[leg]; for ( int tempInt=0;tempInt<leg; tempInt++ ) { if( buffReader.ready() ) { charArray2[tempInt] = (char)buffReader.read( ); System.out.print( charArray2[tempInt] ); } } System.out.println( " Read bytes"); } :) bye n sorry for my mails next time i promise will b more careful subzero ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html