com.colloquial.arithcode
Class Converter

java.lang.Object
  |
  +--com.colloquial.arithcode.Converter

final class Converter
extends java.lang.Object

Package utility class for converting integers to bytes and back again in a uniform manner. Could put this in ByteSet.

Since:
1.1
Version:
1.1
Author:
Bob Carpenter

Constructor Summary
(package private) Converter()
           
 
Method Summary
(package private) static int byteToInteger(byte b)
          Returns integer code for the specified byte.
(package private) static byte integerToByte(int i)
          Returns byte coded by the specified integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Converter

Converter()
Method Detail

integerToByte

static byte integerToByte(int i)
Returns byte coded by the specified integer.

Parameters:
i - Integer to conver to a byte.
Returns:
Byte coded by the specified integer.

byteToInteger

static int byteToInteger(byte b)
Returns integer code for the specified byte.

Parameters:
b - Byte to code as an integer.
Returns:
Integer code for the specified byte.