Java BCD Convert To bcd2Ascii(byte[] bytes)

Here you can find the source of bcd2Ascii(byte[] bytes)

Description

bcd Ascii

License

Apache License

Declaration

public static byte[] bcd2Ascii(byte[] bytes) 

Method Source Code

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

public class Main {

    public static byte[] bcd2Ascii(byte[] bytes) {
        byte[] temp = new byte[bytes.length * 2];

        for (int i = 0; i < bytes.length; i++) {
            temp[i * 2] = (byte) ((bytes[i] >> 4) & 0x0f);
            temp[i * 2 + 1] = (byte) (bytes[i] & 0x0f);

        }//w w  w .jav  a2  s  . c om
        return temp;
    }
}

Related

  1. BCD2ASC(byte[] bytes)
  2. bcd2str(byte[] b)
  3. bcd2str(byte[] b, int offset, int len, boolean padLeft)
  4. bcd2Str(byte[] bytes)
  5. bcd2String(byte[] bytes)