Java Byte Array to Hex String bytesToHexAppend(byte[] bs, int off, int length, StringBuffer sb)

Here you can find the source of bytesToHexAppend(byte[] bs, int off, int length, StringBuffer sb)

Description

bytes To Hex Append

License

Apache License

Declaration

public static final void bytesToHexAppend(byte[] bs, int off, int length, StringBuffer sb) 

Method Source Code

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

public class Main {
    public static final void bytesToHexAppend(byte[] bs, int off, int length, StringBuffer sb) {
        sb.ensureCapacity(sb.length() + length * 2);
        for (int i = off; i < (off + length) && i < bs.length; i++) {
            sb.append(Character.forDigit((bs[i] >>> 4) & 0xf, 16));
            sb.append(Character.forDigit(bs[i] & 0xf, 16));
        }/*  w w  w . j av  a 2 s . c om*/
    }
}

Related

  1. bytes2hexStr(byte[] arr, int len)
  2. bytes_to_hex(byte[] b)
  3. bytes_to_hex(byte[] bytes)
  4. bytesToHexChars(byte[] bytes)
  5. bytesToHexChars(byte[] bytes)
  6. bytesToHexChars(byte[] bytes)
  7. bytesToHexChecksum(byte[] byteArr)