public class FileObjectStorage<T>
extends java.lang.Object
| Constructor and Description |
|---|
FileObjectStorage()
Creates a new file object storage in a temporary file (created by
File.tempFile).
|
FileObjectStorage(java.io.File storageFile)
Creates a new file object storage.
|
FileObjectStorage(java.io.File storageFile,
boolean deleteOnFinalize)
Creates a new file object storage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendObject(T o) |
protected T |
bytes2object(byte[] bytes) |
void |
clear() |
protected void |
createIndex() |
protected void |
finalize() |
protected java.io.RandomAccessFile |
getAccess() |
java.util.Iterator<T> |
getIterator() |
T |
getObject(int index) |
java.io.File |
getStorageFile() |
protected byte[] |
object2bytes(T o) |
void |
setDeleteOnFinalize(boolean delete) |
public FileObjectStorage()
throws java.io.IOException
java.io.IOException - Is thrown if creating temp-file failed.public FileObjectStorage(java.io.File storageFile)
storageFile - File for storing objects.public FileObjectStorage(java.io.File storageFile,
boolean deleteOnFinalize)
storageFile - File for storing objects.deleteOnFinalize - true, file is deleted during finalizing.public java.io.File getStorageFile()
public void setDeleteOnFinalize(boolean delete)
public void appendObject(T o) throws java.io.IOException
java.io.IOExceptionpublic T getObject(int index)
public java.util.Iterator<T> getIterator()
public void clear()
protected java.io.RandomAccessFile getAccess()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprotected byte[] object2bytes(T o) throws java.io.IOException
java.io.IOExceptionprotected T bytes2object(byte[] bytes) throws java.io.IOException
java.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected final void createIndex()
© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.