public int readParams(Properties props) throws IOException{
        int nameLen, valueLen;
        byte lenBuff[] = new byte[3];
        int i = 1;

        while ((nameLen = in.read()) != -1) {
            i++;
            if ((nameLen & 0x80) != 0) {
                if ((in.read( lenBuff, 0, 3)) != 3) {
                    in.setFCGIError(
                        FCGIGlobalDefs.def_FCGIParamsError);
                    return -1;
                }
                nameLen = ((nameLen & 0x7f) << 24)
                    | ((lenBuff[0] & 0xFF) << 16)
                    | ((lenBuff[1] & 0xFF) << 8)
                    | (lenBuff[2] & 0xFF);
            }

            if ((valueLen = in.read()) == -1) {
                in.setFCGIError(
                    FCGIGlobalDefs.def_FCGIParamsError);
                return -1;
            }
            if ((valueLen & 0x80) != 0) {
                if ((in.read( lenBuff, 0, 3)) != 3) {
                    in.setFCGIError(
                        FCGIGlobalDefs.def_FCGIParamsError);
                    return -1;
                }
                valueLen = ((valueLen & 0x7f) << 24)
                    | ((lenBuff[0] & 0xFF) << 16)
                    | ((lenBuff[1] & 0xFF) << 8)
                    | (lenBuff[2] & 0xFF);
            }

            /*
             * nameLen and valueLen are now valid; read the name
             * and the value from the stream and construct a standard
             * environmental entity
             */
            byte[] name  = new byte[nameLen];
            byte[] value = new byte[valueLen];
            if (in.read(name ,0,  nameLen) != nameLen) {
                in.setFCGIError(
                    FCGIGlobalDefs.def_FCGIParamsError);
                return -1;
            }

            if(in.read(value, 0, valueLen) != valueLen) {
                in.setFCGIError(
                    FCGIGlobalDefs.def_FCGIParamsError);
                return -1;
            }
            String strName  = new String(name);
            String strValue = new String(value);
            props.put(strName, strValue);
        }
        return 0;


    }