List of utility methods to do Char Convert To
byte[] | charTo2Byte(char x) char To Byte return new byte[] { (byte) (x >> 8), (byte) x }; |
int | CharToASCII(final char character) Convert the characters to ASCII value return (int) character; |
T | charToBasicType(char c, Class char To Basic Type if (clazz.equals(Boolean.class)) return (T) Boolean.valueOf(charToBoolean(c)); if (clazz.equals(Byte.class)) return (T) charToByte(c); if (clazz.equals(Character.class)) return (T) Character.valueOf(c); if (clazz.equals(Short.class)) return (T) Short.valueOf((short) c); ... |
boolean | charToBoolean(char c) char To Boolean return c != 0 ? true : false;
|
void | charToBuffer(char ch, byte[] ioBuffer) char To Buffer ioBuffer[0] = (byte) (ch >>> 8); ioBuffer[1] = (byte) ch; |
String | charToCDATA(char ch) Converts a character to CDATA character. int c; if (ch >= 128) { c = ch; return ("&#" + c + ';'); else { return (String.valueOf(ch)); |
byte | charToCompressedBaseLow(final int base) Convert from ASCII byte to BAM nybble representation of a base in low-order nybble. switch (base) { case '=': return COMPRESSED_EQUAL_LOW; case 'a': case 'A': return COMPRESSED_A_LOW; case 'c': case 'C': ... |
byte | charToCompressedBaseLow(final int base) Convert from ASCII byte to BAM nybble representation of a base in low-order nybble. switch (base) { case '=': return COMPRESSED_EQUAL_LOW; case 'a': case 'A': return COMPRESSED_A_LOW; case 'c': case 'C': ... |
byte | charToCp1252(char c) char To Cp byte byteVal; if (c > 0 && c < '\u0080' || c >= '\u00a0' && c <= '\u00ff') { byteVal = (byte) c; } else if (c == '\u20ac') { byteVal = (byte) -128; } else if (c == '\u201a') { byteVal = (byte) -126; } else if (c == '\u0192') { ... |
int | charToDecimal(char c) char To Decimal if (c >= '0' && c <= '9') return c - '0'; else if (c >= 'a' && c <= 'z') return 10 + (c - 'a'); throw new IllegalArgumentException("cannot convert " + c + " to decimal"); |