public class ByteUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NON_ASCII_STRING |
Constructor and Description |
---|
ByteUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
bytesToHex(byte[] bytes) |
static String |
bytesToHex(byte[] bytes,
int groupSize) |
static long |
convertTextBytes(String text) |
static void |
debugFrame(Logger logger,
String message,
io.netty.buffer.ByteBuf byteIn) |
static boolean |
equals(byte[] left,
byte[] right) |
static boolean |
equals(byte[] left,
byte[] right,
int rightOffset,
int rightLength) |
static boolean |
equals(byte[] bytes,
io.netty.buffer.ByteBuf byteBuf,
int offset,
int length)
|
static String |
formatGroup(String str,
int groupSize,
int lineBreak) |
static byte[] |
getActiveArray(ByteBuffer buffer) |
static byte[] |
hexToBytes(String hexStr) |
static int |
intFromBytes(byte b1,
byte b2,
byte b3,
byte b4) |
static byte[] |
longToBytes(long x) |
static String |
maxString(String value,
int size) |
static String |
readLine(ActiveMQBuffer buffer) |
static String |
toSimpleString(byte[] bytes) |
public static final String NON_ASCII_STRING
public static void debugFrame(Logger logger, String message, io.netty.buffer.ByteBuf byteIn)
public static String bytesToHex(byte[] bytes)
public static String bytesToHex(byte[] bytes, int groupSize)
public static String toSimpleString(byte[] bytes)
public static byte[] longToBytes(long x)
public static byte[] hexToBytes(String hexStr)
public static String readLine(ActiveMQBuffer buffer)
public static byte[] getActiveArray(ByteBuffer buffer)
public static long convertTextBytes(String text)
public static boolean equals(byte[] left, byte[] right)
public static boolean equals(byte[] left, byte[] right, int rightOffset, int rightLength)
public static boolean equals(byte[] bytes, io.netty.buffer.ByteBuf byteBuf, int offset, int length)
true
if the SimpleString
encoded content into bytes
is equals to s
,
false
otherwise.
It assumes that the bytes
content is read using SimpleString.readSimpleString(ByteBuf, int)
ie starting right after the
length field.
public static int intFromBytes(byte b1, byte b2, byte b3, byte b4)
Copyright © 2019 JBoss by Red Hat. All rights reserved.