i++;
while (++i < abyte0.length && abyte0[i + 1] != IAC);
   protected final boolean negotiate(byte abyte0[]) throws IOException {      int i = 0;      // from server negotiations      if(abyte0[i] == IAC) { // -1         while(i < abyte0.length && abyte0[i++] == -1)            switch(abyte0[i++]) {               // we will not worry about what it WONT do               case WONT:            // -4               default:                 break;               case DO: //-3                  switch(abyte0[i]) {                     case TERMINAL_TYPE: // 24                        baosp.write(IAC);                        baosp.write(WILL);                        baosp.write(TERMINAL_TYPE);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                    case OPT_END_OF_RECORD: // 25                        baosp.write(IAC);                        baosp.write(WILL);                        baosp.write(OPT_END_OF_RECORD);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                    case TRANSMIT_BINARY: // 0                        baosp.write(IAC);                        baosp.write(WILL);                        baosp.write(TRANSMIT_BINARY);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                    case TIMING_MARK: // 6   rfc860//                        System.out.println("Timing Mark Received and notifying " +//                        "the server that we will not do it");                        baosp.write(IAC);                        baosp.write(WONT);                        baosp.write(TIMING_MARK);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                    case NEW_ENVIRONMENT: // 39 rfc1572                        if (devName == null) {                           baosp.write(IAC);                           baosp.write(WONT);                           baosp.write(NEW_ENVIRONMENT);                           writeByte(baosp.toByteArray());                           baosp.reset();                        }                        else {                           System.out.println(devName);                           baosp.write(IAC);                           baosp.write(WILL);                           baosp.write(NEW_ENVIRONMENT);                           writeByte(baosp.toByteArray());                           baosp.reset();                        }                        break;                    default:  // every thing else we will not do at this time                        baosp.write(IAC);                        baosp.write(WONT);                        baosp.write(abyte0[i]); // either                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                 }                 i++;                 break;               case WILL:                 switch(abyte0[i]) {                    case OPT_END_OF_RECORD: // 25                        baosp.write(IAC);                        baosp.write(DO);                        baosp.write(OPT_END_OF_RECORD);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                    case TRANSMIT_BINARY: // '\0'                        baosp.write(IAC);                        baosp.write(DO);                        baosp.write(TRANSMIT_BINARY);                        writeByte(baosp.toByteArray());                        baosp.reset();                        break;                 }                 i++;                 break;               case SB: // -6                  if(abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) {                     negNewEnvironment();                     i++;                  }                  if(abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) {                     baosp.write(IAC);                     baosp.write(SB);                     baosp.write(TERMINAL_TYPE);                     baosp.write(QUAL_IS);                     if(!support132)                         baosp.write((new String("IBM-3179-2")).getBytes());                     else                         baosp.write((new String("IBM-3477-FC")).getBytes());                     baosp.write(IAC);                     baosp.write(SE);                     writeByte(baosp.toByteArray());                     baosp.reset();                     i++;                  }                  i++;                  break;            }            return true;      }      else {         return false;      }   }