/** * Returns the int resulting from reversing 4 bytes of a specified * int. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public int swapInt(int v) { return (swapInt(intToBytes(v), 0)); }
/** * Returns the long resulting from reversing 8 bytes of a specified * long. * * @param l input value for which byte reversal is desired * @return the value represented by the bytes of <code>l</code> * reversed */ static public long swapLong(long l) { return (swapLong(longToBytes(l), 0)); }
/** * Returns the short resulting from swapping 2 bytes of a specified * short. * * @param s input value for which byte reversal is desired * @return the value represented by the bytes of <code>s</code> * reversed */ static public short swapShort(short s) { return (swapShort(shortToBytes(s), 0)); }
/** * Returns the float resulting from reversing 4 bytes of a specified * float. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public float swapFloat(float v) { int l = swapInt(Float.floatToIntBits(v)); return (Float.intBitsToFloat(l)); }
/** * Returns the double resulting from reversing 8 bytes of a specified * double. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public double swapDouble(double v) { long l = swapLong(Double.doubleToLongBits(v)); return (Double.longBitsToDouble(l)); }
/** * Returns the float resulting from reversing 4 bytes of a specified * float. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public float swapFloat(float v) { int l = swapInt(Float.floatToIntBits(v)); return (Float.intBitsToFloat(l)); }
/** * Returns the double resulting from reversing 8 bytes of a specified * double. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public double swapDouble(double v) { long l = swapLong(Double.doubleToLongBits(v)); return (Double.longBitsToDouble(l)); }
/** * Returns the short resulting from swapping 2 bytes of a specified * short. * * @param s input value for which byte reversal is desired * @return the value represented by the bytes of <code>s</code> * reversed */ static public short swapShort(short s) { return (swapShort(shortToBytes(s), 0)); }
/** * Returns the int resulting from reversing 4 bytes of a specified * int. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public int swapInt(int v) { return (swapInt(intToBytes(v), 0)); }
/** * Returns the long resulting from reversing 8 bytes of a specified * long. * * @param l input value for which byte reversal is desired * @return the value represented by the bytes of <code>l</code> * reversed */ static public long swapLong(long l) { return (swapLong(longToBytes(l), 0)); }
/** * Returns the float resulting from reversing 4 bytes of a specified * float. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public float swapFloat(float v) { int l = swapInt(Float.floatToIntBits(v)); return (Float.intBitsToFloat(l)); }
/** * Returns the double resulting from reversing 8 bytes of a specified * double. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public double swapDouble(double v) { long l = swapLong(Double.doubleToLongBits(v)); return (Double.longBitsToDouble(l)); }
/** * Returns the short resulting from swapping 2 bytes of a specified * short. * * @param s input value for which byte reversal is desired * @return the value represented by the bytes of <code>s</code> * reversed */ static public short swapShort(short s) { return (swapShort(shortToBytes(s), 0)); }
/** * Returns the int resulting from reversing 4 bytes of a specified * int. * * @param v input value for which byte reversal is desired * @return the value represented by the bytes of <code>v</code> * reversed */ static public int swapInt(int v) { return (swapInt(intToBytes(v), 0)); }
/** * Returns the long resulting from reversing 8 bytes of a specified * long. * * @param l input value for which byte reversal is desired * @return the value represented by the bytes of <code>l</code> * reversed */ static public long swapLong(long l) { return (swapLong(longToBytes(l), 0)); }