public class ImportExport extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ImportExport.ExportReport |
static class |
ImportExport.ProcessReadException
An exception rose during a deserialization process.
|
static class |
ImportExport.ReadException
The list of exception raised during a read process.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
SERIALIZATION_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static ImportExport.ExportReport |
exportPersistingElements(CloseableIterator<? extends PersistingElement> elementsIterator,
ObjectOutputStream out)
Serialize a binary representation for elements in an OutputStream.
|
static long |
importPersistingElements(InputStream fis)
Import a serialized set in a InputStream.
|
static long |
importPersistingElements(String file)
Import a serialized set from a file.
|
static <T extends PersistingElement> |
readSerializedPersistingElements(InputStream fis,
Process<T> process)
Processes sequentially each element of a serialized stream without importing them.
|
static long |
readSerializedPersistingElements(String file,
Process<? extends PersistingElement> process)
Processes sequentially each element of a serialized file without importing them.
|
public static final String SERIALIZATION_SEPARATOR
public static ImportExport.ExportReport exportPersistingElements(CloseableIterator<? extends PersistingElement> elementsIterator, ObjectOutputStream out) throws IOException
elementsIterator - an iterator over the elements to be serialized ; closed by the methodIOExceptionpublic static long importPersistingElements(InputStream fis) throws DatabaseNotReachedException, IOException, ClassNotFoundException, ImportExport.ReadException
fis - the input stream to import from ; must support InputStream.markSupported()DatabaseNotReachedExceptionIOExceptionClassNotFoundExceptionImportExport.ReadExceptionpublic static <T extends PersistingElement> long readSerializedPersistingElements(InputStream fis, Process<T> process) throws DatabaseNotReachedException, IOException, ClassNotFoundException, ImportExport.ReadException
fis - the input stream of elementsprocess - the process to be applied to each elementImportExport.ReadException - errors while processing elementsDatabaseNotReachedExceptionIOExceptionClassNotFoundExceptionpublic static long importPersistingElements(String file) throws DatabaseNotReachedException, IOException, ClassNotFoundException, ImportExport.ReadException
file - the file to import fromDatabaseNotReachedExceptionIOExceptionClassNotFoundExceptionImportExport.ReadExceptionpublic static long readSerializedPersistingElements(String file, Process<? extends PersistingElement> process) throws DatabaseNotReachedException, IOException, ClassNotFoundException, ImportExport.ReadException
file - the file to import fromprocess - the process to be applied to each elementImportExport.ReadException - errors while processing elementsDatabaseNotReachedExceptionIOExceptionClassNotFoundExceptionCopyright © 2016. All Rights Reserved.