public static String decodeWord(String s)
    {
        if(!s.startsWith("=?"))
return s;
        int i = 2;
        int j;
        if((j = s.indexOf(63, i)) == -1)
            return s;
        String s1 = (s.substring(i, j));
        i = j + 1;
        if((j = s.indexOf(63, i)) == -1)
            return s;
        String s2 = s.substring(i, j);
        i = j + 1;
        if((j = s.indexOf("?=", i)) == -1)
            return s;
        String s3 = s.substring(i, j);
        try
        {
            ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(s3.getBytes());
            Object obj;
            if(s2.equalsIgnoreCase("B"))
                obj = new com.sun.mail.util.BASE64DecoderStream(bytearrayinputstream);
            else
            if(s2.equalsIgnoreCase("Q"))
                obj = new com.sun.mail.util.QDecoderStream(bytearrayinputstream);
            else
                return s;
            int k = bytearrayinputstream.available();
            byte abyte0[] = new byte[k];
            k = ((InputStream) (obj)).read(abyte0, 0, k);
            return new String(abyte0, 0, k );
        }
        catch(Exception ex)
        {
return s;
        }
    }