|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfutils.SerialUtils
public class SerialUtils
Constructor Summary | |
---|---|
SerialUtils()
|
Method Summary | |
---|---|
static byte[] |
getBytes(java.io.Serializable obj)
Convert an object that is Serializable into an array of byte |
static byte[] |
getGzBytes(java.io.Serializable obj)
This is the inverse of the getGZObject method |
static java.lang.Object |
getGzObject(byte[] b)
A means of implementing persistance using gzipped byte arrays |
static java.lang.Object |
getObject(byte[] b)
The inverse of the getBytes method, this reconstitutes and object |
static void |
main(java.lang.String[] args)
|
static void |
print(Customer[] c)
This will print all the customers in a list. |
static java.lang.Object |
readGzippedObject()
|
static java.lang.String |
readGzipString()
Takes file input that is compressed and uncompresses it. |
static java.lang.Object |
readObjectUncompressed()
|
static void |
saveGzipObject(java.lang.Object o)
|
static void |
saveObjectUncompressed(java.lang.Object o)
|
static void |
saveReadGzipObjectTest()
|
static void |
testReadGzipObject()
|
static void |
testReadWriteGzipString()
|
static void |
testSaveGzipString()
|
static void |
testTheTest()
|
static void |
writeGzipString(java.lang.String s)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerialUtils()
Method Detail |
---|
public static void testReadGzipObject()
public static java.lang.Object readGzippedObject() throws java.io.IOException, java.io.FileNotFoundException, java.lang.ClassNotFoundException
java.io.IOException
java.io.FileNotFoundException
java.lang.ClassNotFoundException
public static java.lang.Object readObjectUncompressed() throws java.io.IOException, java.io.FileNotFoundException, java.lang.ClassNotFoundException
java.io.IOException
java.io.FileNotFoundException
java.lang.ClassNotFoundException
public static void saveGzipObject(java.lang.Object o) throws java.io.IOException
java.io.IOException
public static void saveReadGzipObjectTest()
public static void testSaveGzipString()
public static void testReadWriteGzipString()
public static java.lang.String readGzipString() throws java.io.IOException
java.io.IOException
public static void writeGzipString(java.lang.String s) throws java.io.IOException
java.io.IOException
public static void saveObjectUncompressed(java.lang.Object o) throws java.io.IOException
java.io.IOException
public static void print(Customer[] c)
c
- a customer arraypublic static void testTheTest()
public static byte[] getGzBytes(java.io.Serializable obj) throws java.io.IOException
obj
- must be serializable
java.io.IOException
- this should never happenpublic static java.lang.Object getGzObject(byte[] b) throws java.io.IOException, java.lang.ClassNotFoundException
b
- a byte array of a serializable, gzipped instance
java.io.IOException
- this should not happen
java.lang.ClassNotFoundException
- this will happen if the class changes.public static byte[] getBytes(java.io.Serializable obj) throws java.io.IOException
obj
- must be serializable
java.io.IOException
- this should never happenpublic static java.lang.Object getObject(byte[] b) throws java.io.IOException, java.lang.ClassNotFoundException
b
- the array of bytes containing an instance of a known class.
java.io.IOException
- this should never happen
java.lang.ClassNotFoundException
- this will happen if the class is unknownpublic static void main(java.lang.String[] args) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |