Java ASCII ascii2Bcd(byte[] asc)

Here you can find the source of ascii2Bcd(byte[] asc)

Description

ascii Bcd

License

Apache License

Declaration

public static byte[] ascii2Bcd(byte[] asc) 

Method Source Code

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

public class Main {

    public static byte[] ascii2Bcd(byte[] asc) {
        int len = asc.length / 2;
        byte[] bcd = new byte[len];
        for (int i = 0; i < len; i++) {
            bcd[i] = (byte) ((asc[2 * i] << 4) | asc[2 * i + 1]);
        }/*from   w w  w . j  a  v  a2  s.  c  o m*/
        return bcd;
    }
}

Related

  1. ascii(final int c)
  2. ascii(String string)
  3. ascii2BCD(byte[] val, int len)
  4. AsciiBTAddressToBytes(String btAddress)
  5. asciiBytes(String x)
  6. asciiChar(int value)