class SignedBinary
extends java.lang.Object
short
, int
, or long
.Modifier and Type | Field and Description |
---|---|
static int |
BIG_ENDIAN
AS/400, Unix, System/390 byte-order for signed binary representations.
|
static int |
LITTLE_ENDIAN
Intel 80/86 reversed byte-order for signed binary representations.
|
Modifier | Constructor and Description |
---|---|
private |
SignedBinary() |
Modifier and Type | Method and Description |
---|---|
static int |
bigEndianBytesToInt(byte[] buffer,
int offset)
Build a Java int from a 4-byte big endian signed binary representation.
|
static long |
bigEndianBytesToLong(byte[] buffer,
int offset)
Build a Java long from an 8-byte big endian signed binary representation.
|
static short |
bigEndianBytesToShort(byte[] buffer,
int offset)
Build a Java short from a 2-byte big endian signed binary representation.
|
static int |
getInt(byte[] buffer,
int offset,
int byteOrder)
Build a Java int from a 4-byte signed binary representation.
|
static long |
getLong(byte[] buffer,
int offset,
int byteOrder)
Build a Java long from an 8-byte signed binary representation.
|
static short |
getShort(byte[] buffer,
int offset,
int byteOrder)
Build a Java short from a 2-byte signed binary representation.
|
static int |
littleEndianBytesToInt(byte[] buffer,
int offset)
Build a Java int from a 4-byte little endian signed binary representation.
|
static long |
littleEndianBytesToLong(byte[] buffer,
int offset)
Build a Java long from an 8-byte little endian signed binary representation.
|
static short |
littleEndianBytesToShort(byte[] buffer,
int offset)
Build a Java short from a 2-byte little endian signed binary representation.
|
public static final int BIG_ENDIAN
public static final int LITTLE_ENDIAN
public static short getShort(byte[] buffer, int offset, int byteOrder)
Depending on machine type, byte orders are
BIG_ENDIAN
for signed binary integers, and
LITTLE_ENDIAN
for pc8087 signed binary integers.
java.lang.IllegalArgumentException
- if the specified byte order is not recognized.public static int getInt(byte[] buffer, int offset, int byteOrder)
Depending on machine type, byte orders are
BIG_ENDIAN
for signed binary integers, and
LITTLE_ENDIAN
for pc8087 signed binary integers.
java.lang.IllegalArgumentException
- if the specified byte order is not recognized.public static long getLong(byte[] buffer, int offset, int byteOrder)
Depending on machine type, byte orders are
BIG_ENDIAN
for signed binary integers, and
LITTLE_ENDIAN
for pc8087 signed binary integers.
java.lang.IllegalArgumentException
- if the specified byte order is not recognized.public static short bigEndianBytesToShort(byte[] buffer, int offset)
public static short littleEndianBytesToShort(byte[] buffer, int offset)
public static int bigEndianBytesToInt(byte[] buffer, int offset)
public static int littleEndianBytesToInt(byte[] buffer, int offset)
public static long bigEndianBytesToLong(byte[] buffer, int offset)
public static long littleEndianBytesToLong(byte[] buffer, int offset)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.