public final class BytesHelper extends Object
Modifier and Type | Method and Description |
---|---|
static long |
asLong(byte[] bytes)
Interpret the binary representation of a long.
|
static byte[] |
fromInt(int intValue)
Interpret an int as its binary form
|
static byte[] |
fromLong(long longValue)
Interpret a long as its binary form
|
static byte[] |
fromShort(int shortValue)
Interpret a short as its binary form
|
static String |
toBinaryString(byte value) |
static String |
toBinaryString(int value) |
static String |
toBinaryString(long value) |
static int |
toInt(byte[] bytes)
Custom algorithm used to generate an int from a series of bytes.
|
public static int toInt(byte[] bytes)
bytes
- The bytes to use in generating the int.public static byte[] fromShort(int shortValue)
shortValue
- The short to interpret to binarypublic static byte[] fromInt(int intValue)
intValue
- The int to interpret to binarypublic static byte[] fromLong(long longValue)
longValue
- The long to interpret to binarypublic static long asLong(byte[] bytes)
bytes
- The bytes to interpret.public static String toBinaryString(byte value)
public static String toBinaryString(int value)
public static String toBinaryString(long value)
Copyright © 2017 JBoss by Red Hat. All rights reserved.