Java Byte to Hex String byteToHexString(byte b)

Here you can find the source of byteToHexString(byte b)

Description

Convert the byte b into an hex String

License

Open Source License

Parameter

Parameter Description
b a parameter

Declaration

public static Object byteToHexString(byte b) 

Method Source Code

//package com.java2s;
/**//from   w  ww  . j av a2 s . com
 * Copyright (c) 2010-2018 by the respective copyright holders.
 *
 * 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 {
    /**
     * Convert the byte b into an hex String
     *
     * @param b
     * @return
     */
    public static Object byteToHexString(byte b) {
        return Integer.toHexString(b & 0xFF) + " ";
    }
}

Related

  1. byteToHexStr(byte buf[])
  2. byteToHexStr(byte src, int len, int code)
  3. byteToHexstr(byte[] b, boolean space)
  4. byteToHexStr(byte[] bArray)
  5. byteToHexString(byte _b)
  6. byteToHexString(byte b)
  7. byteToHexString(byte b)
  8. byteToHexString(byte b)
  9. byteToHexString(byte b)