Java Byte to String byteToArrayString(byte bByte)

Here you can find the source of byteToArrayString(byte bByte)

Description

byte To Array String

License

Apache License

Declaration

private static String byteToArrayString(byte bByte) 

Method Source Code

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

public class Main {
    private final static String[] strDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c",
            "d", "e", "f" };

    private static String byteToArrayString(byte bByte) {
        int iRet = bByte;
        if (iRet < 0) {
            iRet += 256;/*from   ww  w . j a v  a 2s .  co m*/
        }
        int iD1 = iRet / 16;
        int iD2 = iRet % 16;
        return strDigits[iD1] + strDigits[iD2];
    }
}

Related

  1. byteToStr(byte input)
  2. byteToString(byte b)
  3. byteToString(byte b)
  4. byteToString(byte b)