Java Char to Byte convertCharToByte(char[] from)

Here you can find the source of convertCharToByte(char[] from)

Description

convert Char To Byte

License

Open Source License

Declaration

static public byte[] convertCharToByte(char[] from) 

Method Source Code

//package com.java2s;

public class Main {
    static public byte[] convertCharToByte(char[] from) {
        int size = from.length;
        byte[] to = new byte[size];
        for (int i = 0; i < size; i++)
            to[i] = (byte) from[i]; // LOOK wrong, convert back to unsigned byte ???
        return to;
    }/*from ww  w  . j a v  a2 s .  c o m*/
}

Related

  1. charToByte(char[] chars)
  2. charToByte(char[] tab)
  3. charToByte(char[] values)
  4. charToByte(final char value)
  5. convertCharToByte(char firstChar, char secondChar)
  6. convertCharToByte(char[] source, int srclen)
  7. convertCharToBytes(char c)