com.servingxml.util
Class ByteHelper

java.lang.Object
  extended by com.servingxml.util.ByteHelper

public class ByteHelper
extends java.lang.Object


Constructor Summary
ByteHelper()
           
 
Method Summary
static byte highNibble(byte b)
          Extracts the upper 4 bits of a byte.
static byte lowNibble(byte b)
          Extracts the lower 4 bits of a byte.
static byte makeByte(byte lo, byte hi)
          Makes a byte from a low nibble and a high nibble.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteHelper

public ByteHelper()
Method Detail

lowNibble

public static final byte lowNibble(byte b)
Extracts the lower 4 bits of a byte.

Parameters:
b - The byte
Returns:
The lower 4 bits of the supplied byte.

highNibble

public static final byte highNibble(byte b)
Extracts the upper 4 bits of a byte.

Parameters:
b - The byte.
Returns:
The upper 4 bits of the supplied byte.

makeByte

public static final byte makeByte(byte lo,
                                  byte hi)
Makes a byte from a low nibble and a high nibble.

Parameters:
lo - The lower four bits of the byte.
hi - The upper four bits of the byte.
Returns:
The byte.