Here you can find the source of appendHexByte(final StringBuilder sb, final byte b)
private static final void appendHexByte(final StringBuilder sb, final byte b)
//package com.java2s; /*//from w w w. j av a 2 s . c o m * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ public class Main { private static final char[] HEX_CHARS = "0123456789abcdef" .toCharArray(); private static final void appendHexByte(final StringBuilder sb, final byte b) { final int v = Byte.toUnsignedInt(b); sb.append(HEX_CHARS[v >>> 4]); sb.append(HEX_CHARS[v & 15]); } }