Java Char to Byte charToByte(char c)

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

Description

char To Byte

License

LGPL

Declaration

public static Byte charToByte(char c) 

Method Source Code

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

public class Main {
    public static Byte charToByte(char c) {
        if (c >= Byte.MIN_VALUE && c <= Byte.MAX_VALUE) {
            return (byte) c;
        }/*w w  w.  j ava2s. com*/
        return null;
    }

    public static byte charToByte(char c, byte defaultValue) {
        if (c >= Byte.MIN_VALUE && c <= Byte.MAX_VALUE) {
            return (byte) c;
        }
        return defaultValue;
    }
}

Related

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