com.fernsroth.easyio.util
Class EasyIOUtils

java.lang.Object
  extended by com.fernsroth.easyio.util.EasyIOUtils

public final class EasyIOUtils
extends java.lang.Object

utilities for working with EasyRW.

Author:
Joseph M. Ferner (Near Infinity Corporation)

Method Summary
static int getClassSize(java.lang.Class<?> clazz)
          gets the number of bytes the class will take up.
static java.lang.Object mask(java.lang.Object val, int bits)
          masks an object(number) by x number of bits.
static java.lang.Object or(java.lang.Object val1, java.lang.Object val2)
          or to objects(numbers) together.
static java.lang.Object shift(java.lang.Object val, int bits)
          shift the object (number) by bits.
static java.lang.String toHexString(long value, int length)
          converts a number to a hex string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toHexString

public static java.lang.String toHexString(long value,
                                           int length)
converts a number to a hex string.

Parameters:
value - the value to convert.
length - the length to output.
Returns:
the string.

getClassSize

public static int getClassSize(java.lang.Class<?> clazz)
                        throws EasyIOException,
                               java.io.IOException
gets the number of bytes the class will take up.

Parameters:
clazz - the class.
Returns:
the number of bytes.
Throws:
EasyIOException
java.io.IOException

shift

public static java.lang.Object shift(java.lang.Object val,
                                     int bits)
shift the object (number) by bits.

Parameters:
val - the value to shift.
bits - the number of bits to shift.
Returns:
the shifted number.

mask

public static java.lang.Object mask(java.lang.Object val,
                                    int bits)
masks an object(number) by x number of bits.

Parameters:
val - the value to mask.
bits - the number of bits to mask.
Returns:
the masked number.

or

public static java.lang.Object or(java.lang.Object val1,
                                  java.lang.Object val2)
or to objects(numbers) together.

Parameters:
val1 - the first value.
val2 - the second value.
Returns:
the or'ed value.


Copyright © 2006 null. All Rights Reserved.