public final class HexUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char[] |
DIGITS |
Modifier and Type | Method and Description |
---|---|
static void |
appendHex(java.lang.StringBuilder builder,
int b)
Deprecated.
|
static java.lang.String |
bytesToHex(byte[] bs) |
static java.lang.String |
bytesToHex(byte[] bs,
int off,
int length)
Converts a byte array into a string of lower case hex chars.
|
static void |
bytesToHex(java.io.InputStream bs,
java.io.Writer writer) |
static void |
bytesToHexAppend(byte[] bs,
int off,
int length,
java.lang.Appendable appendable) |
static java.lang.String |
formatByte(int b)
Deprecated.
|
static java.lang.String |
formatBytes(byte[] bytes)
Deprecated.
|
static void |
hexToBytes(java.io.Reader s,
java.io.OutputStream outputStream) |
static byte[] |
hexToBytes(java.lang.String s) |
static void |
hexToBytes(java.lang.String s,
byte[] out,
int off)
Converts a String of hex characters into an array of bytes.
|
static byte[] |
hexToBytes(java.lang.String s,
int off) |
static java.lang.String |
longToHex(long v) |
public static java.lang.String bytesToHex(byte[] bs, int off, int length)
bs
- A byte arrayoff
- The index of the first byte to readlength
- The number of bytes to read.public static void bytesToHexAppend(byte[] bs, int off, int length, java.lang.Appendable appendable)
public static void bytesToHex(java.io.InputStream bs, java.io.Writer writer)
public static java.lang.String bytesToHex(byte[] bs)
public static byte[] hexToBytes(java.lang.String s)
public static byte[] hexToBytes(java.lang.String s, int off)
public static void hexToBytes(java.lang.String s, byte[] out, int off) throws java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
s
- A string of hex characters (upper case or lower) of even length.out
- A byte array of length at least s.length()/2 + offoff
- The first byte to write of the arrayjava.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public static void hexToBytes(java.io.Reader s, java.io.OutputStream outputStream) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.lang.String longToHex(long v)
@Deprecated public static java.lang.String formatByte(int b)
@Deprecated public static java.lang.String formatBytes(byte[] bytes)
@Deprecated public static void appendHex(java.lang.StringBuilder builder, int b)
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) 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