public final class

BytesHelper

extends Object
java.lang.Object
   ↳ org.hibernate.util.BytesHelper

Summary

Public Methods
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(long value)
static String toBinaryString(int value)
static int toInt(byte[] bytes)
Custom algorithm used to generate an int from a series of bytes.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static long asLong (byte[] bytes)

Interpret the binary representation of a long.

Parameters
bytes The bytes to interpret.
Returns
  • The long

public static byte[] fromInt (int intValue)

Interpret an int as its binary form

Parameters
intValue The int to interpret to binary
Returns
  • The binary

public static byte[] fromLong (long longValue)

Interpret a long as its binary form

Parameters
longValue The long to interpret to binary
Returns
  • The binary

public static byte[] fromShort (int shortValue)

Interpret a short as its binary form

Parameters
shortValue The short to interpret to binary
Returns
  • The binary

public static String toBinaryString (byte value)

public static String toBinaryString (long value)

public static String toBinaryString (int value)

public static int toInt (byte[] bytes)

Custom algorithm used to generate an int from a series of bytes.

NOTE : this is different than interpreting the incoming bytes as an int value!

Parameters
bytes The bytes to use in generating the int.
Returns
  • The generated int.