| 
 | 
 | |||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.ByteArrayUtil
public final class ByteArrayUtil
Class with various utilities for manipulating byte arrays.
 
 If you find a reusable copy of this in the Java API, please tell me. Using a
 ByteArrayOutputStream and DataInputStream
 doesn't seem appropriate.
 
 C.f. DataOutputStream and ByteArrayOutputStream
| Constructor Summary | |
|---|---|
| ByteArrayUtil() | |
| Method Summary | |
|---|---|
| static double | readDouble(byte[] array,
           int offset)Read a double from the byte array at the given offset. | 
| static float | readFloat(byte[] array,
          int offset)Read a float from the byte array at the given offset. | 
| static int | readInt(byte[] array,
        int offset)Read an integer from the byte array at the given offset. | 
| static long | readLong(byte[] array,
         int offset)Read a long from the byte array at the given offset. | 
| static short | readShort(byte[] array,
          int offset)Read a short from the byte array at the given offset. | 
| static int | readUnsignedShort(byte[] array,
                  int offset)Read an unsigned short from the byte array at the given offset. | 
| static void | writeDouble(byte[] array,
            int offset,
            double v)Write a double to the byte array at the given offset. | 
| static void | writeFloat(byte[] array,
           int offset,
           float v)Write a float to the byte array at the given offset. | 
| static void | writeInt(byte[] array,
         int offset,
         int v)Write an integer to the byte array at the given offset. | 
| static void | writeLong(byte[] array,
          int offset,
          long v)Write a long to the byte array at the given offset. | 
| static void | writeShort(byte[] array,
           int offset,
           int v)Write a short to the byte array at the given offset. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ByteArrayUtil()
| Method Detail | 
|---|
public static final void writeShort(byte[] array,
                                    int offset,
                                    int v)
array - Array to write tooffset - Offset to write tov - data
public static final void writeInt(byte[] array,
                                  int offset,
                                  int v)
array - Array to write tooffset - Offset to write tov - data
public static final void writeLong(byte[] array,
                                   int offset,
                                   long v)
array - Array to write tooffset - Offset to write tov - data
public static final void writeFloat(byte[] array,
                                    int offset,
                                    float v)
array - Array to write tooffset - Offset to write tov - data
public static final void writeDouble(byte[] array,
                                     int offset,
                                     double v)
array - Array to write tooffset - Offset to write tov - data
public static final short readShort(byte[] array,
                                    int offset)
array - Array to read fromoffset - Offset to read at
public static final int readUnsignedShort(byte[] array,
                                          int offset)
array - Array to read fromoffset - Offset to read at
public static final int readInt(byte[] array,
                                int offset)
array - Array to read fromoffset - Offset to read at
public static final long readLong(byte[] array,
                                  int offset)
array - Array to read fromoffset - Offset to read at
public static final float readFloat(byte[] array,
                                    int offset)
array - Array to read fromoffset - Offset to read at
public static final double readDouble(byte[] array,
                                      int offset)
array - Array to read fromoffset - Offset to read at
| 
 | 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||