Java Hex String Create appendHexPair(byte b, StringBuffer sb)

Here you can find the source of appendHexPair(byte b, StringBuffer sb)

Description

append Hex Pair

License

Open Source License

Declaration

private static void appendHexPair(byte b, StringBuffer sb) 

Method Source Code

//package com.java2s;

public class Main {
    public static char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
            'f' };

    private static void appendHexPair(byte b, StringBuffer sb) {
        char c0 = hexDigits[(b & 0xf0) >> 4];
        char c1 = hexDigits[b & 0x0f];
        sb.append(c0);/*from  www.j  ava  2  s .  com*/
        sb.append(c1);
    }
}

Related

  1. appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex)
  2. appendHexEntity(final StringBuilder out, final char value)
  3. appendHexEscape(StringBuilder out, int codePoint)
  4. appendHexJavaScriptRepresentation(StringBuilder sb, char c)
  5. appendHexNumber(StringBuffer target, byte b)
  6. appendHexStream(StringBuilder sb, byte[] bytes, String delimiter, boolean prefixEachValue, boolean upperCase)
  7. appendHexString(StringBuffer buffer, byte data)
  8. appendHexString(StringBuilder buffer, byte[] bytes)
  9. appendHexString(StringBuilder builder, int value)