Java BCD Convert To bcdToByte(byte src)

Here you can find the source of bcdToByte(byte src)

Description

bcd To Byte

License

Apache License

Declaration

private static byte bcdToByte(byte src) 

Method Source Code

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

public class Main {

    private static byte bcdToByte(byte src) {
        byte re = src;
        if (src <= 0x09 && src >= 0x00)
            re = (byte) (src + 0x30);
        else if (src <= 0x0f && src >= 0x0a)
            re = (byte) (src + 0x37);
        return re;
    }// www  .  j  av  a  2 s  .c om
}

Related

  1. bcd2str(byte[] b)
  2. bcd2str(byte[] b, int offset, int len, boolean padLeft)
  3. bcd2Str(byte[] bytes)
  4. bcd2String(byte[] bytes)
  5. bcdNibbleToInt(byte b, boolean high)
  6. BCDtoInt(int bcd)
  7. BCDToLong(byte[] bcdByte)
  8. bcdToLong(byte[] src, int flag)
  9. bcdToString(byte[] bcd)