Java Char to Byte charToByte(char c)

Here you can find the source of charToByte(char c)

Description

Convert char to byte

License

Open Source License

Parameter

Parameter Description
c char

Return

byte

Declaration

public static byte charToByte(char c) 

Method Source Code

//package com.java2s;

public class Main {
    /** /*  w w  w .  ja  v a  2s  . c o  m*/
     * Convert char to byte 
     *  
     * @param c 
     *            char 
     * @return byte 
     */
    public static byte charToByte(char c) {
        return (byte) "0123456789ABCDEF".indexOf(c);
    }
}

Related

  1. char2Byte(char ch)
  2. charToByte(char aChar)
  3. charToByte(char c)
  4. charToByte(char c)
  5. charToByte(char c)
  6. charToByte(char ch)
  7. charToByte(char ch)
  8. charToByte(char encodedChar)
  9. charToByte(char[] chars)