Android Hex String Create appendHex(StringBuffer stringbuffer, byte byte0)

Here you can find the source of appendHex(StringBuffer stringbuffer, byte byte0)

Description

append Hex

License

Open Source License

Declaration

private static void appendHex(StringBuffer stringbuffer, byte byte0) 

Method Source Code

//package com.java2s;

public class Main {
    /** A table of hex digits */
    public static final char[] hexDigit = { '0', '1', '2', '3', '4', '5',
            '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

    private static void appendHex(StringBuffer stringbuffer, byte byte0) {
        stringbuffer.append(toHexChar(byte0 >> 4));
        stringbuffer.append(toHexChar(byte0));
    }/*  w w  w.ja v a 2s.  com*/

    /**
     * Convert a nibble to a hex character
     * 
     * @param nibble
     *          the nibble to convert.
     */
    public static char toHexChar(int nibble) {
        return hexDigit[(nibble & 0xF)];
    }
}

Related

  1. isHex(String sampleData)
  2. isHexStringChar(char c)
  3. FileNamePathExtension(String filename)
  4. pathExtension(String fileName)
  5. hexStringToBytes(String hexString)
  6. toHexString(char achar0)
  7. decodeHexStr(final String str)
  8. hexDigest(String input)
  9. hexToBt64(String hex)