Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.client.am
Class SignedBinary  view SignedBinary download SignedBinary.java

java.lang.Object
  extended byorg.apache.derby.client.am.SignedBinary

public class SignedBinary
extends java.lang.Object


Field Summary
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.
 
Constructor Summary
private SignedBinary()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIG_ENDIAN

public static final int BIG_ENDIAN
Unix byte-order for signed binary representations.

See Also:
Constant Field Values

LITTLE_ENDIAN

public static final int LITTLE_ENDIAN
Intel 80/86 reversed byte-order for signed binary representations.

See Also:
Constant Field Values
Constructor Detail

SignedBinary

private SignedBinary()
Method Detail

getShort

public static final short getShort(byte[] buffer,
                                   int offset)
Build a Java short from a 2-byte signed binary representation.


getInt

public static final int getInt(byte[] buffer,
                               int offset)
Build a Java int from a 4-byte signed binary representation.


getLong

public static final long getLong(byte[] buffer,
                                 int offset)
Build a Java long from an 8-byte signed binary representation.


shortToBigEndianBytes

public static final void shortToBigEndianBytes(byte[] buffer,
                                               int offset,
                                               short v)
Write a Java short to a 2-byte big endian signed binary representation.


intToBigEndianBytes

public static final void intToBigEndianBytes(byte[] buffer,
                                             int offset,
                                             int v)
Write a Java int to a 4-byte big endian signed binary representation.


longToBigEndianBytes

public static final void longToBigEndianBytes(byte[] buffer,
                                              int offset,
                                              long v)
Write a Java long to an 8-byte big endian signed binary representation.