|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.util.SerializationUtils
public class SerializationUtils
The SerializationUtils provide static methods, that read/write
float and int data to/from a byte array.
| Constructor Summary | |
|---|---|
SerializationUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
loadObject(java.io.File file)
Loads an Object. |
static java.lang.Object |
loadObject(java.io.InputStream in)
Loads an Object. |
static java.lang.Object |
loadObject(java.lang.String filename)
Loads an Object. |
static boolean |
readBoolFromBuffer(int pos,
byte[] buffer)
Reads a boolean from one byte at the specified position of the byte array. |
static void |
readBoolsFromBuffer(int pos,
byte[] buffer,
boolean[] out)
Reads a boolean-array from one byte each at the specified position of the byte array. |
static void |
readBoolsFromBuffer(int pos,
byte[] buffer,
boolean[] out,
int start,
int length)
Reads a boolean-array from one byte each at the specified position of the byte array. |
static double |
readDoubleFromBuffer(int pos,
byte[] buffer)
Reads a double from eight bytes at the specified position of the byte array. |
static void |
readDoublesFromBuffer(int pos,
byte[] buffer,
double[] out)
Reads a double-array from eight bytes each at the specified position of the byte array. |
static void |
readDoublesFromBuffer(int pos,
byte[] buffer,
double[] out,
int start,
int length)
Reads a double-array from eight bytes each at the specified position of the byte array. |
static float |
readFloatFromBuffer(int pos,
byte[] buffer)
Reads a float from four bytes at the specified position of the byte array. |
static void |
readFloatsFromBuffer(int pos,
byte[] buffer,
float[] out)
Reads a float-array from four bytes each at the specified position of the byte array. |
static void |
readFloatsFromBuffer(int pos,
byte[] buffer,
float[] out,
int start,
int length)
Reads a float-array from four bytes each at the specified position of the byte array. |
static int |
readIntFromBuffer(int pos,
byte[] buffer)
Reads an int from four bytes at the specified position of the byte array. |
static void |
readIntsFromBuffer(int pos,
byte[] buffer,
int[] out)
Reads an int-array from four bytes each at the specified position of the byte array. |
static void |
readIntsFromBuffer(int pos,
byte[] buffer,
int[] out,
int start,
int length)
Reads an int-array from four bytes each at the specified position of the byte array. |
static long |
readLongFromBuffer(int pos,
byte[] buffer)
Reads an long from eight bytes at the specified position of the byte array. |
static void |
readLongsFromBuffer(int pos,
byte[] buffer,
long[] out)
Reads an long-array from eight bytes each at the specified position of the byte array. |
static void |
readLongsFromBuffer(int pos,
byte[] buffer,
long[] out,
int start,
int length)
Reads an long-array from eight bytes each at the specified position of the byte array. |
static void |
saveObject(java.lang.Object object,
java.io.File file)
Stores a Serializable Object. |
static void |
saveObject(java.lang.Object object,
java.io.OutputStream out)
Stores a Serializable Object. |
static void |
saveObject(java.lang.Object object,
java.lang.String filename)
Stores a Serializable Object. |
static void |
writeToBuffer(boolean[] bools,
int pos,
byte[] buffer)
Writes a boolean-array as one byte each to the specified position of the byte array. |
static void |
writeToBuffer(boolean[] bools,
int start,
int length,
int pos,
byte[] buffer)
Writes a boolean-array as one byte each to the specified position of the byte array. |
static void |
writeToBuffer(boolean b,
int pos,
byte[] buffer)
Writes a boolean as one byte to the specified position of the byte array. |
static void |
writeToBuffer(double[] doubles,
int start,
int length,
int pos,
byte[] buffer)
Writes a double-array as four bytes each to the specified position of the byte array. |
static void |
writeToBuffer(double d,
int pos,
byte[] buffer)
Writes a double as eight bytes to the specified position of the byte array. |
static void |
writeToBuffer(float[] floats,
int pos,
byte[] buffer)
Writes an int-array as four bytes each to the specified position of the byte array. |
static void |
writeToBuffer(float[] floats,
int start,
int length,
int pos,
byte[] buffer)
Writes a float-array as four bytes each to the specified position of the byte array. |
static void |
writeToBuffer(float f,
int pos,
byte[] buffer)
Writes a float as four bytes to the specified position of the byte array. |
static void |
writeToBuffer(int[] ints,
int pos,
byte[] buffer)
Writes an int-array as four bytes each to the specified position of the byte array. |
static void |
writeToBuffer(int[] ints,
int start,
int length,
int pos,
byte[] buffer)
Writes an int-array as four bytes each to the specified position of the byte array. |
static void |
writeToBuffer(int i,
int pos,
byte[] buffer)
Writes an int as four bytes to the specified position of the byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SerializationUtils()
| Method Detail |
|---|
public static final void writeToBuffer(int i,
int pos,
byte[] buffer)
i - the int to writepos - the position to write to (and the succeeding three bytes)buffer - the byte array to write to
public static final void writeToBuffer(int[] ints,
int start,
int length,
int pos,
byte[] buffer)
ints - the int-array to writestart - the index of the first int to writelength - the number of ints to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(int[] ints,
int pos,
byte[] buffer)
ints - the int-array to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(float f,
int pos,
byte[] buffer)
f - the float to writepos - the position to write to (and the succeeding three bytes)buffer - the byte array to write to
public static final void writeToBuffer(float[] floats,
int start,
int length,
int pos,
byte[] buffer)
floats - the float-array to writestart - the index of the first float to writelength - the number of floats to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(double d,
int pos,
byte[] buffer)
d - the double to writepos - the position to write to (and the succeeding three bytes)buffer - the byte array to write to
public static final void writeToBuffer(double[] doubles,
int start,
int length,
int pos,
byte[] buffer)
doubles - the double-array to writestart - the index of the first double to writelength - the number of doubles to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(float[] floats,
int pos,
byte[] buffer)
floats - the float-array to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(boolean b,
int pos,
byte[] buffer)
b - the boolean to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(boolean[] bools,
int start,
int length,
int pos,
byte[] buffer)
bools - the boolean-array to writestart - the index of the first boolean to writelength - the number of booleans to writepos - the position to write tobuffer - the byte array to write to
public static final void writeToBuffer(boolean[] bools,
int pos,
byte[] buffer)
bools - the boolean-array to writepos - the position to write tobuffer - the byte array to write to
public static final int readIntFromBuffer(int pos,
byte[] buffer)
pos - the position to start reading atbuffer - the byte array to read from
public static final void readIntsFromBuffer(int pos,
byte[] buffer,
int[] out,
int start,
int length)
pos - the position to start reading atbuffer - the byte array to read fromout - the int-array to write values tostart - the index of the first int to readlength - the number of ints to read
public static final void readIntsFromBuffer(int pos,
byte[] buffer,
int[] out)
pos - the position to start reading atbuffer - the byte array to read fromout - the int-array to write values to
public static final long readLongFromBuffer(int pos,
byte[] buffer)
pos - the position to start reading atbuffer - the byte array to read from
public static final void readLongsFromBuffer(int pos,
byte[] buffer,
long[] out,
int start,
int length)
pos - the position to start reading atbuffer - the byte array to read fromout - the long-array to write values tostart - the index of the first long to readlength - the number of longs to read
public static final void readLongsFromBuffer(int pos,
byte[] buffer,
long[] out)
pos - the position to start reading atbuffer - the byte array to read fromout - the long-array to write values to
public static final float readFloatFromBuffer(int pos,
byte[] buffer)
pos - the position to start reading atbuffer - the byte array to read from
public static final void readFloatsFromBuffer(int pos,
byte[] buffer,
float[] out,
int start,
int length)
pos - the position to start reading atbuffer - the byte array to read fromout - the float-array to write values tostart - the index of the first float to readlength - the number of floats to read
public static final void readFloatsFromBuffer(int pos,
byte[] buffer,
float[] out)
pos - the position to start reading atbuffer - the byte array to read fromout - the float-array to write values to
public static final double readDoubleFromBuffer(int pos,
byte[] buffer)
pos - the position to start reading atbuffer - the byte array to read from
public static final void readDoublesFromBuffer(int pos,
byte[] buffer,
double[] out,
int start,
int length)
pos - the position to start reading atbuffer - the byte array to read fromout - the double-array to write values tostart - the index of the first double to readlength - the number of doubles to read
public static final void readDoublesFromBuffer(int pos,
byte[] buffer,
double[] out)
pos - the position to start reading atbuffer - the byte array to read fromout - the double-array to write values to
public static final boolean readBoolFromBuffer(int pos,
byte[] buffer)
pos - the position to start reading atbuffer - the byte array to read from
public static final void readBoolsFromBuffer(int pos,
byte[] buffer,
boolean[] out,
int start,
int length)
pos - the position to start reading atbuffer - the byte array to read fromout - the boolean-array to write values tostart - the index of the first boolean to readlength - the number of booleans to read
public static final void readBoolsFromBuffer(int pos,
byte[] buffer,
boolean[] out)
pos - the position to start reading atbuffer - the byte array to read fromout - the boolean-array to write values to
public static void saveObject(java.lang.Object object,
java.io.OutputStream out)
throws java.io.IOException
object - out -
java.io.IOException
public static void saveObject(java.lang.Object object,
java.lang.String filename)
throws java.io.IOException
object - filename -
java.io.IOException
public static void saveObject(java.lang.Object object,
java.io.File file)
throws java.io.IOException
object - file -
java.io.IOException
public static java.lang.Object loadObject(java.io.InputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
in -
java.io.IOException
java.lang.ClassNotFoundException
public static java.lang.Object loadObject(java.lang.String filename)
throws java.io.IOException,
java.lang.ClassNotFoundException
filename -
java.io.IOException
java.lang.ClassNotFoundException
public static java.lang.Object loadObject(java.io.File file)
throws java.io.IOException,
java.lang.ClassNotFoundException
file -
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||