switch (Integer.valueOf(theProps.getProperty("sms.gsm.myBit", "8")).intValue()){
switch (Integer.valueOf(theProps.getProperty("sms.gsm.bit", "8")).intValue()){
    public void init(Properties theProps) throws SmsException    {        mySerialPortName=theProps.getProperty("sms.gsm.serialport", "COM1");        CommPortIdentifier portId = null;        Enumeration portList = CommPortIdentifier.getPortIdentifiers();        /* find the requested port */        while (portList.hasMoreElements()) {            portId = (CommPortIdentifier) portList.nextElement();            /* Check for serial port */            if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {                if (portId.getName().equals(mySerialPortName)) {                    try {                        mySerialPort = (SerialPort) portId.open(GsmTransport.class.getName(), 3000);                    } catch (PortInUseException e) {                        myLog.error("Port "+mySerialPortName+" already open.", e);                       throw new SmsException("Port "+mySerialPortName+" already open.");                    }                }            }        }        /* port not found */        if(mySerialPort == null) {            myLog.error("Port "+mySerialPortName+" does not exist.");            throw new SmsException("Port "+mySerialPortName+" does not exist.");        }        /* Open streams to the port */        try {            myOutStream = mySerialPort.getOutputStream();            myInStream = mySerialPort.getInputStream();        } catch (IOException e) {            mySerialPort.close();            myLog.error("Cannot open streams", e);            throw new SmsException("Cannot open streams.");        }        /* Configure port */        myBitRate = Integer.valueOf(theProps.getProperty("sms.gsm.bitrate", "19200")).intValue();        myBit=SerialPort.DATABITS_8;        switch (Integer.valueOf(theProps.getProperty("sms.gsm.myBit", "8")).intValue()){            case 5: myBit=SerialPort.DATABITS_5; break;            case 6: myBit=SerialPort.DATABITS_6; break;            case 7: myBit=SerialPort.DATABITS_7; break;            case 8: myBit=SerialPort.DATABITS_8; break;        }        myStopbits=SerialPort.STOPBITS_1;        String st = theProps.getProperty("sms.gsm.stopbits", "1");        if (st.equals("1")) myStopbits=SerialPort.STOPBITS_1;        else if (st.equals("1.5")) myStopbits=SerialPort.STOPBITS_1_5;        else if (st.equals("2")) myStopbits=SerialPort.STOPBITS_2;        myParity=SerialPort.PARITY_NONE;        st = theProps.getProperty("sms.gsm.parity", "NONE").toUpperCase();        if (st.equals("NONE")) myParity=SerialPort.PARITY_NONE;        else if (st.equals("EVEN")) myParity=SerialPort.PARITY_EVEN;        else if (st.equals("ODD")) myParity=SerialPort.PARITY_ODD;        else if (st.equals("MARK")) myParity=SerialPort.PARITY_MARK;        else if (st.equals("SPACE")) myParity=SerialPort.PARITY_SPACE;        myFlowControl=SerialPort.FLOWCONTROL_RTSCTS_IN|SerialPort.FLOWCONTROL_RTSCTS_OUT;        st = theProps.getProperty("sms.gsm.flowcontrol", "NONE").toUpperCase();        if (st.equals("RTSCTS")) myFlowControl=SerialPort.FLOWCONTROL_RTSCTS_IN|SerialPort.FLOWCONTROL_RTSCTS_OUT;        else if (st.equals("XONXOFF")) myFlowControl=SerialPort.FLOWCONTROL_XONXOFF_IN|SerialPort.FLOWCONTROL_XONXOFF_OUT;        else if (st.equals("NONE")) myFlowControl=mySerialPort.FLOWCONTROL_NONE;        StringTokenizer stk = new StringTokenizer(theProps.getProperty("sms.gsm.initcommands", "AT+CMGF=0"));        myInitCmds = new String[stk.countTokens()];        for (int i=0; stk.hasMoreTokens(); i++)        {            myInitCmds[i] = stk.nextToken();        }    }