protected String removenullbyte(String thestring)
    {
        byte[] stringbyte = thestring.getBytes();
        int a = 0;
        while (stringbyte[a] != 0x00)
        {
            a++;
        }
        return thestring.substring(0, a);
    }