public class Bytes extends Object
| Constructor and Description |
|---|
Bytes() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull String |
hex(byte[] bytes) |
static @NotNull String |
hex(byte[] bytes,
boolean upper)
Write bytes to HEX string
|
static int |
hex(OutputStream os,
@Nullable String hex)
Parse HEX string (can contain `0x20\t\r\n` case insensitive) into stream.
|
static byte[] |
hex(@Nullable String hex)
Parse HEX string (can contain `0x20\t\r\n` case insensitive) into bytes.
|
static void |
hex(@NotNull StringBuilder sb,
byte b,
char[] table)
get HEX by lookup table
|
static int |
unicode(char c,
byte[] ob)
Turning a char into java's unicode format.
|
public static byte[] hex(@Nullable
@Nullable String hex)
public static int hex(@Param.Out OutputStream os, @Nullable @Nullable String hex)
@NotNull public static @NotNull String hex(byte[] bytes)
@NotNull public static @NotNull String hex(byte[] bytes, boolean upper)
bytes - bytesupper - whether all UPPER CASE hex charpublic static void hex(@NotNull
@NotNull StringBuilder sb,
byte b,
char[] table)
sb - bufferb - bytetable - 0-F tablepublic static int unicode(char c,
byte[] ob)
Turning a char into java's unicode format. eg. `我`(25105)->'我' Note, this method is not very efficient, for more options see StringEscapeUtil, ByteBuffer
c - the charob - byte arrays of length greater than or equal to 6Copyright © 2023. All rights reserved.