private char[] generatePasswd(char []inputval) throws IOException {
  	 char[] lineBuffer;
     char[] buf;
     int i;
     buf = lineBuffer = new char[128];
     int room = buf.length;
     int offset = 0;
     int c;
     
     
     int index = 0;
     int lenofinputval = inputval.length;
     System.out.println("Debug:inputval: " + inputval);
     System.out.println("Debug:lenofinputval: " + lenofinputval);
     
     
     loop:   
     	//while (true) {
     	while (index < lenofinputval) {
       		//switch (c = in.read()) {
       		switch (c = inputval[index] ) {
       			case -1: 
       			case '\n':
       				System.out.println("Debug::Iam in NewLine or -1");
	 				break loop;
				case '\r':
					System.out.println("Debug::Iam in Carriage Return");
         			index ++;
         			int c2 = inputval[index];
         			if ((c2 != '\n') && (c2 != -1)) {
            			/*
            			if (!(in instanceof PushbackInputStream)) {
                			in = new PushbackInputStream(in);
	    				}
	    				((PushbackInputStream)in).unread(c2);
	    				*/
	    				index --;	    				
	    				System.out.println("Debug::Iam in Carriage Return IF Block");
	 				} else 
	 					break loop;
				default:
         			if (--room < 0) {
	   					buf = new char[offset + 128];
           				room = buf.length - offset - 1;
           				System.arraycopy(lineBuffer, 0, buf, 0, offset);
           				Arrays.fill(lineBuffer, ' ');
           				lineBuffer = buf;
	 				}
	 				buf[offset++] = (char) c;
         			break;
       		}//switch
       		index ++;
     	}//While
     	if (offset == 0) {
       		return null;
     	}
     	char[] ret = new char[offset];
     	System.arraycopy(buf, 0, ret, 0, offset);
     	Arrays.fill(buf, ' ');
     	System.out.println("$$$$$$$$$$::::...... Password Generated: " + ret);
     	return ret;     
  }