Top Constructors Methods
org.hibernate.internal.util

public final Class BytesHelper

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

The long
asLong
(byte[]
The bytes to interpret.
bytes
)

Interpret the binary representation of a long.

public static long

Returns:

The long
asLong
(byte[]
The bytes to interpret.
bytes
,
int
starting position in the source array.
srcPos
)

Interpret the binary representation of a long.

public static byte[]

Returns:

The binary
fromInt
(int
The int to interpret to binary
intValue
)

Interpret an int as its binary form

public static byte[]

Returns:

The binary
fromLong
(long
The long to interpret to binary
longValue
)

Interpret a long as its binary form

public static void
fromLong(long
The long to interpret to binary
longValue
,
byte[]
the destination array.
dest
,
int
starting position in the destination array.
destPos
)

Interpret a long as its binary form

public static byte[]

Returns:

The binary
fromShort
(int
The short to interpret to binary
shortValue
)

Interpret a short as its binary form

public static String
toBinaryString(byte value)

public static String
toBinaryString(int value)

public static String
toBinaryString(long value)

public static int

Returns:

The generated int.
toInt
(byte[]
The bytes to use in generating the int.
bytes
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BytesHelperback to summary
private BytesHelper()

Method Detail

asLongback to summary
public static long asLong(byte[] bytes)

Interpret the binary representation of a long.

Parameters
bytes:byte[]

The bytes to interpret.

Returns:long

The long

asLongback to summary
public static long asLong(byte[] bytes, int srcPos)

Interpret the binary representation of a long.

Parameters
bytes:byte[]

The bytes to interpret.

srcPos:int

starting position in the source array.

Returns:long

The long

fromIntback to summary
public static byte[] fromInt(int intValue)

Interpret an int as its binary form

Parameters
intValue:int

The int to interpret to binary

Returns:byte[]

The binary

fromLongback to summary
public static byte[] fromLong(long longValue)

Interpret a long as its binary form

Parameters
longValue:long

The long to interpret to binary

Returns:byte[]

The binary

fromLongback to summary
public static void fromLong(long longValue, byte[] dest, int destPos)

Interpret a long as its binary form

Parameters
longValue:long

The long to interpret to binary

dest:byte[]

the destination array.

destPos:int

starting position in the destination array.

fromShortback to summary
public static byte[] fromShort(int shortValue)

Interpret a short as its binary form

Parameters
shortValue:int

The short to interpret to binary

Returns:byte[]

The binary

toBinaryStringback to summary
public static String toBinaryString(byte value)
toBinaryStringback to summary
public static String toBinaryString(int value)
toBinaryStringback to summary
public static String toBinaryString(long value)
toIntback to summary
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:byte[]

The bytes to use in generating the int.

Returns:int

The generated int.