@Deprecated
public class Swap
extends java.lang.Object
| Constructor and Description | 
|---|
Swap()
Deprecated.  
  | 
| Modifier and Type | Method and Description | 
|---|---|
static byte[] | 
intToBytes(int v)
Deprecated.  
Convert an int to an array of 4 bytes. 
 | 
static byte[] | 
longToBytes(long v)
Deprecated.  
Convert a long to an array of 8 bytes. 
 | 
static byte[] | 
shortToBytes(short v)
Deprecated.  
Convert a short to an array of 2 bytes. 
 | 
static char | 
swapChar(byte[] b,
        int offset)
Deprecated.  
Returns the char resulting from swapping 2 bytes at a specified
 offset in a byte array. 
 | 
static double | 
swapDouble(byte[] b,
          int offset)
Deprecated.  
Returns the double resulting from reversing 8 bytes at a specified
 offset in a byte array. 
 | 
static double | 
swapDouble(double v)
Deprecated.  
Returns the double resulting from reversing 8 bytes of a specified
 double. 
 | 
static float | 
swapFloat(byte[] b,
         int offset)
Deprecated.  
Returns the float resulting from reversing 4 bytes at a specified
 offset in a byte array. 
 | 
static float | 
swapFloat(float v)
Deprecated.  
Returns the float resulting from reversing 4 bytes of a specified
 float. 
 | 
static int | 
swapInt(byte[] b,
       int offset)
Deprecated.  
Returns the int resulting from reversing 4 bytes at a specified
 offset in a byte array. 
 | 
static int | 
swapInt(int v)
Deprecated.  
Returns the int resulting from reversing 4 bytes of a specified
 int. 
 | 
static long | 
swapLong(byte[] b,
        int offset)
Deprecated.  
Returns the long resulting from reversing 8 bytes at a specified
 offset in a byte array. 
 | 
static long | 
swapLong(long l)
Deprecated.  
Returns the long resulting from reversing 8 bytes of a specified
 long. 
 | 
static short | 
swapShort(byte[] b,
         int offset)
Deprecated.  
Returns the short resulting from swapping 2 bytes at a specified
 offset in a byte array. 
 | 
static short | 
swapShort(short s)
Deprecated.  
Returns the short resulting from swapping 2 bytes of a specified
 short. 
 | 
public static short swapShort(byte[] b,
                              int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+1], b[offset]public static int swapInt(byte[] b,
                          int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+3], b[offset+2], ..., b[offset]public static long swapLong(byte[] b,
                            int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+7], b[offset+6], ..., b[offset]public static float swapFloat(byte[] b,
                              int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+3], b[offset+2], ..., b[offset]public static double swapDouble(byte[] b,
                                int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+7], b[offset+6], ..., b[offset]public static char swapChar(byte[] b,
                            int offset)
b - the byte arrayoffset - the offset of the first byteb[offset+1], b[offset]public static short swapShort(short s)
s - input value for which byte reversal is desireds
         reversedpublic static int swapInt(int v)
v - input value for which byte reversal is desiredv
         reversedpublic static long swapLong(long l)
l - input value for which byte reversal is desiredl
         reversedpublic static float swapFloat(float v)
v - input value for which byte reversal is desiredv
         reversedpublic static double swapDouble(double v)
v - input value for which byte reversal is desiredv
         reversedpublic static byte[] shortToBytes(short v)
v - input valuepublic static byte[] intToBytes(int v)
v - input valuepublic static byte[] longToBytes(long v)
v - input value