Top Description Fields Constructors Methods
org.apache.derby.impl.drda

pack-priv Class SignedBinary

extends Object
Class Inheritance

Converters from signed binary bytes to Java short, int, or long.

Field Summary

Modifier and TypeField and Description
public static final int
BIG_ENDIAN

AS/400, Unix, System/390 byte-order for signed binary representations.

public static final int
LITTLE_ENDIAN

Intel 80/86 reversed byte-order for signed binary representations.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int
bigEndianBytesToInt(byte[] buffer, int offset)

Build a Java int from a 4-byte big endian signed binary representation.

public static long
bigEndianBytesToLong(byte[] buffer, int offset)

Build a Java long from an 8-byte big endian signed binary representation.

public static short
bigEndianBytesToShort(byte[] buffer, int offset)

Build a Java short from a 2-byte big endian signed binary representation.

public static int
getInt(byte[] buffer, int offset, int byteOrder)

Build a Java int from a 4-byte signed binary representation.

public static long
getLong(byte[] buffer, int offset, int byteOrder)

Build a Java long from an 8-byte signed binary representation.

public static short
getShort(byte[] buffer, int offset, int byteOrder)

Build a Java short from a 2-byte signed binary representation.

public static int
littleEndianBytesToInt(byte[] buffer, int offset)

Build a Java int from a 4-byte little endian signed binary representation.

public static long
littleEndianBytesToLong(byte[] buffer, int offset)

Build a Java long from an 8-byte little endian signed binary representation.

public static short
littleEndianBytesToShort(byte[] buffer, int offset)

Build a Java short from a 2-byte little endian signed binary representation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIG_ENDIANback to summary
public static final int BIG_ENDIAN

AS/400, Unix, System/390 byte-order for signed binary representations.

LITTLE_ENDIANback to summary
public static final int LITTLE_ENDIAN

Intel 80/86 reversed byte-order for signed binary representations.

Constructor Detail

SignedBinaryback to summary
private SignedBinary()

Method Detail

bigEndianBytesToIntback to summary
public static int bigEndianBytesToInt(byte[] buffer, int offset)

Build a Java int from a 4-byte big endian signed binary representation.

bigEndianBytesToLongback to summary
public static long bigEndianBytesToLong(byte[] buffer, int offset)

Build a Java long from an 8-byte big endian signed binary representation.

bigEndianBytesToShortback to summary
public static short bigEndianBytesToShort(byte[] buffer, int offset)

Build a Java short from a 2-byte big endian signed binary representation.

getIntback to summary
public static int getInt(byte[] buffer, int offset, int byteOrder)

Build a Java int from a 4-byte signed binary representation.

Depending on machine type, byte orders are BIG_ENDIAN for signed binary integers, and LITTLE_ENDIAN for pc8087 signed binary integers.

Exceptions
IllegalArgumentException:
if the specified byte order is not recognized.
getLongback to summary
public static long getLong(byte[] buffer, int offset, int byteOrder)

Build a Java long from an 8-byte signed binary representation.

Depending on machine type, byte orders are BIG_ENDIAN for signed binary integers, and LITTLE_ENDIAN for pc8087 signed binary integers.

Exceptions
IllegalArgumentException:
if the specified byte order is not recognized.
getShortback to summary
public static short getShort(byte[] buffer, int offset, int byteOrder)

Build a Java short from a 2-byte signed binary representation.

Depending on machine type, byte orders are BIG_ENDIAN for signed binary integers, and LITTLE_ENDIAN for pc8087 signed binary integers.

Exceptions
IllegalArgumentException:
if the specified byte order is not recognized.
littleEndianBytesToIntback to summary
public static int littleEndianBytesToInt(byte[] buffer, int offset)

Build a Java int from a 4-byte little endian signed binary representation.

littleEndianBytesToLongback to summary
public static long littleEndianBytesToLong(byte[] buffer, int offset)

Build a Java long from an 8-byte little endian signed binary representation.

littleEndianBytesToShortback to summary
public static short littleEndianBytesToShort(byte[] buffer, int offset)

Build a Java short from a 2-byte little endian signed binary representation.