Here you can find the source of rot13(final byte b)
public static final byte rot13(final byte b)
//package com.java2s; //License from project: Open Source License public class Main { private static final byte a = (byte) 'a'; private static final byte z = (byte) 'z'; private static final byte A = (byte) 'A'; private static final byte Z = (byte) 'Z'; public static final byte rot13(final byte b) { if (b >= a && b <= z) { final byte c = (byte) (b + 13); if (c > z) { return (byte) (a + c - z); }/* ww w.ja va2 s .c om*/ return c; } else if (b >= A && b <= Z) { final byte c = (byte) (b + 13); if (c > Z) { return (byte) (A + c - Z); } return c; } return b; } }