final StringBuffer line = new StringBuffer();
if ( prompt != null )
{
System.out.print( prompt );
}
while ( true )
{
final int value = mInputStreamReader.read();
if ( value < 0 )
{
if ( line.length() != 0 )
{
// read a line but saw EOF before a newline
break;
}
return( null );
}
final char theChar = (char)value;
if ( theChar == '\n" )
break;
line.append( theChar );
}
return( line.toString().trim() );