All pastes #211041 Raw Edit

Mine

public text v1 · immutable
#211041 ·published 2006-10-20 03:36 UTC
rendered paste body
public class ByteReversalFromStrings {
    public static void main(String args[]) {
        String test = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789(Q(R+R(T(U^(V(Z(X(Y)2_=)0[*U]*W;:(W@(S*X)1<)3>)4?*6*V ";
        System.out.println("Text:    \"" + test + "\";");
        System.out.println("Decoded: \"" + decodeText(test) + "\";");
    }

    public static String decodeText(String text) {
        byte[] bytes = text.getBytes();
        int size = bytes.length;
        String buffer = "";
        for(int seek = 0; seek < size; seek++) {
            int character = bytes[seek] & 0xFF;
            if (character < 46 && character > 39) {
                buffer += (char) ((bytes[++seek] & 0xFF) + ((character - 40) * 43) - 48);
            } else if(character != 0) {
                buffer += (char)character;
            }
        }
        return buffer;
    }
}