net.sf.image4j.io
Class EndianUtils

java.lang.Object
  extended by net.sf.image4j.io.EndianUtils

public class EndianUtils
extends java.lang.Object

Provides utility methods for endian conversions [big-endian to little-endian; little-endian to big-endian].

Author:
Ian McDonagh

Constructor Summary
EndianUtils()
           
 
Method Summary
static double swapDouble(double value)
          Reverses the byte order of the source double value
static float swapFloat(float value)
          Reverses the byte order of the source float value
static int swapInteger(int value)
          Reverses the byte order of the source int value
static long swapLong(long value)
          Reverses the byte order of the source long value
static short swapShort(short value)
          Reverses the byte order of the source short value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndianUtils

public EndianUtils()
Method Detail

swapShort

public static short swapShort(short value)
Reverses the byte order of the source short value

Parameters:
value - the source value
Returns:
the converted value

swapInteger

public static int swapInteger(int value)
Reverses the byte order of the source int value

Parameters:
value - the source value
Returns:
the converted value

swapLong

public static long swapLong(long value)
Reverses the byte order of the source long value

Parameters:
value - the source value
Returns:
the converted value

swapFloat

public static float swapFloat(float value)
Reverses the byte order of the source float value

Parameters:
value - the source value
Returns:
the converted value

swapDouble

public static double swapDouble(double value)
Reverses the byte order of the source double value

Parameters:
value - the source value
Returns:
the converted value