|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swing.persistence.Serializer
public final class Serializer
Support for serializing objects in various formats. Includes support XML (KBML) and Java object serialization and adds optional compression.
Deserializer
Method Summary | |
---|---|
static void |
finishOutput(OutputStream output)
Call this to finalize compressed output streams. |
static OutputStream |
openCompressedOutput(OutputStream output)
Open a compressed output stream. |
static void |
save(Object object,
String file,
SerializedFormat format)
Serialize an object using a given format. |
static void |
saveAsBinary(Object object,
OutputStream stream)
|
static void |
saveAsBinary(Object object,
OutputStream stream,
boolean compress)
|
static void |
saveAsBinary(Object object,
String fileName)
|
static void |
saveAsBinary(Object object,
String fileName,
boolean compress)
|
static void |
saveAsKBML(Object object,
OutputStream stream)
|
static void |
saveAsKBML(Object object,
OutputStream stream,
boolean compress)
|
static void |
saveAsKBML(Object object,
String fileName)
|
static void |
saveAsKBML(Object object,
String fileName,
boolean compress)
|
static void |
writeObject(Object object,
OutputStream output,
SerializedFormat format)
Write an object to an output stream using the appropriate writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void save(Object object, String file, SerializedFormat format) throws FileNotFoundException, IOException
object
- The object to serialize.file
- The file to serialize to.format
- The format to use.
FileNotFoundException
IOException
public static void saveAsBinary(Object object, String fileName) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static void saveAsBinary(Object object, String fileName, boolean compress) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static void saveAsBinary(Object object, OutputStream stream) throws IOException
IOException
public static void saveAsBinary(Object object, OutputStream stream, boolean compress) throws IOException
IOException
public static void saveAsKBML(Object object, String fileName) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static void saveAsKBML(Object object, String fileName, boolean compress) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static void saveAsKBML(Object object, OutputStream stream) throws IOException
IOException
public static void saveAsKBML(Object object, OutputStream stream, boolean compress) throws IOException
IOException
public static OutputStream openCompressedOutput(OutputStream output) throws IOException
finishOutput(java.io.OutputStream)
is made before closing or the stream will be
invalid.
IOException
public static void finishOutput(OutputStream output) throws IOException
IOException
public static void writeObject(Object object, OutputStream output, SerializedFormat format) throws IOException
object
- The object to write.output
- The stream.format
- The format. Only the type is used.
IOException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |