Java Char to Byte charToByte(char c)

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

Description

char To Byte

License

Apache License

Declaration

private static byte charToByte(char c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static final char[] CHARS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
            'C', 'D', 'E', 'F' };

    private static byte charToByte(char c) {
        for (int i = 0; i < CHARS.length; i++) {
            if (c == CHARS[i]) {
                return (byte) i;
            }//  w w  w  . j a  va2  s .co m
        }
        return Byte.MIN_VALUE;
    }
}

Related

  1. char2Byte(char c)
  2. char2byte(char ch)
  3. char2Byte(char ch)
  4. charToByte(char aChar)
  5. charToByte(char c)
  6. charToByte(char c)
  7. charToByte(char c)
  8. charToByte(char ch)
  9. charToByte(char ch)