private int getTypeCode(Object obj){

                int code = 0;

                if(obj instanceof Byte){
                    code = 1;
                }
                else{
                    if(obj instanceof Short){
                        code = 2;
                    }
                    else{
                        if(obj instanceof Integer){
                            code = 3;
                        }
                        else{
                            if(obj instanceof Long){
                                code = 4;
                            }
                            else{
                                if(obj instanceof Float){
                                    code = 5;
                                }
                                else{
                                    if(obj instanceof Double){
                                        code = 6;
                                    }
                                    else{
                                        if(obj instanceof BigInteger){
                                            code = 7;
                                        }
                                        else{
                                            if(obj instanceof BigDecimal){
                                                code = 8;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                return code;
        }