Here you can find the source of bytetoString(byte[] tb)
public static String bytetoString(byte[] tb)
//package com.java2s; /*//from ww w .j a v a2 s . c om * Copyright (c) 2015 Dell Inc. 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 { public static String bytetoString(byte[] tb) { StringBuffer tsb = new StringBuffer(); for (int i = 0; i < tb.length; i++) { tsb.append(Integer.toHexString((int) tb[i])); } return tsb.toString(); } }