List of utility methods to do ASCII to String
String | ascii2Str(String s) ascii Str String[] chars = s.split(" "); StringBuffer result = new StringBuffer(); for (int i = 0; i < chars.length; i++) { result.append((char) Integer.parseInt(chars[i])); return result.toString(); |
String | ascii2String(String ASCIIs) ascii String String[] ASCIIss = ASCIIs.split(","); StringBuffer sb = new StringBuffer(); for (int i = 0; i < ASCIIss.length; i++) { sb.append((char) ascii2Char(Integer.parseInt(ASCIIss[i]))); return sb.toString(); |
char[] | asciiBytesToChar(byte[] bytes) Converts bytes from ascii encoded text to a char[] and zero outs the original byte[] char[] chars = new char[bytes.length]; for (int i = 0; i < bytes.length; i++) { chars[i] = (char) bytes[i]; bytes[i] = '\0'; return chars; |
String | asciiBytesToString(byte[] val) Convert a byte array to a String assuming the ASCII character set, for use in cases (such as early in the boot process) where character set conversion is unavailable or inadvisable.
return asciiBytesToString(val, 0, val.length); |
char | ASCIIToChar(final int ascii) Convert the ASCII value to character return (char) ascii; |
String | AsciiToChar(int asc) Ascii To Char String TempStr = "A"; char tempchar = (char) asc; TempStr = String.valueOf(tempchar); return TempStr; |
String | asciiToLowerCase(String s) ascii To Lower Case char[] c = s.toCharArray(); int i = s.length(); while (i-- > 0) { char c1 = c[i]; if (c1 <= 127) { char c2 = lowercases[c1]; if (c1 != c2) { c[i] = c2; ... |
String | asciiToString(byte ascii) ascii To String switch (ascii) { case (int) '\n': return "\\n"; case (int) '\t': return "\\t"; case 11: return "\\v"; case 7: ... |
String | asciiToString(byte[] b, int off, int len) ascii To String char[] c = new char[len]; for (int i = 0; i < len; ++i) { c[i] = (char) (b[off + i] & 0xff); return new String(c); |
String | asciiToString(int asciiCode) ascii To String return String.valueOf((char) asciiCode); |