Java Char Convert To charTo2Byte(char x)

Here you can find the source of charTo2Byte(char x)

Description

char To Byte

License

Apache License

Declaration

public static byte[] charTo2Byte(char x) 

Method Source Code

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

public class Main {
    public static byte[] charTo2Byte(char x) {
        return new byte[] { (byte) (x >> 8), (byte) x };
    }//ww  w  . j  a  v a 2 s .co  m
}

Related

  1. CharToASCII(final char character)
  2. charToBasicType(char c, Class clazz)
  3. charToBoolean(char c)
  4. charToBuffer(char ch, byte[] ioBuffer)