Android Char to Byte Array Convert charToByte(char c)

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

Description

Convert char to byte

Parameter

Parameter Description
c char

Return

byte

Declaration

private static byte charToByte(char c) 

Method Source Code

//package com.java2s;

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

Related

  1. charToByte(char c)
  2. getBytes(char data)