public class SignedBinary extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BIG_ENDIAN
Unix byte-order for signed binary representations.
|
static int |
LITTLE_ENDIAN
Intel 80/86 reversed byte-order for signed binary representations.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getInt(byte[] buffer,
int offset)
Build a Java int from a 4-byte signed binary representation.
|
static long |
getLong(byte[] buffer,
int offset)
Build a Java long from an 8-byte signed binary representation.
|
static short |
getShort(byte[] buffer,
int offset)
Build a Java short from a 2-byte signed binary representation.
|
static void |
intToBigEndianBytes(byte[] buffer,
int offset,
int v)
Write a Java int to a 4-byte big endian signed binary representation.
|
static void |
longToBigEndianBytes(byte[] buffer,
int offset,
long v)
Write a Java long to an 8-byte big endian signed binary representation.
|
static void |
shortToBigEndianBytes(byte[] buffer,
int offset,
short v)
Write a Java short to a 2-byte big endian signed binary representation.
|
public static final int BIG_ENDIAN
public static final int LITTLE_ENDIAN
public static final short getShort(byte[] buffer,
int offset)
IllegalArgumentException - if the specified byte order is not recognized.public static final int getInt(byte[] buffer,
int offset)
IllegalArgumentException - if the specified byte order is not recognized.public static final long getLong(byte[] buffer,
int offset)
IllegalArgumentException - if the specified byte order is not recognized.public static final void shortToBigEndianBytes(byte[] buffer,
int offset,
short v)
public static final void intToBigEndianBytes(byte[] buffer,
int offset,
int v)
public static final void longToBigEndianBytes(byte[] buffer,
int offset,
long v)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.