| java.lang.Object java.io.InputStream java.io.ObjectInputStream org.archive.io.ObjectPlusFilesInputStream
ObjectPlusFilesInputStream | public class ObjectPlusFilesInputStream extends ObjectInputStream (Code) | | Enhanced ObjectOutputStream with support for restoring
files that had been saved, in parallel with object
serialization.
author: gojomo |
Method Summary | |
public void | close() In addition to default, do any registered cleanup tasks. | public File | getAuxiliaryDirectory() Return the top auxiliary directory, from
which saved files are restored. | public void | popAuxiliaryDirectory() Discard the top auxiliary directory. | public void | pushAuxiliaryDirectory(String dir) Push another default storage directory for use
until popped. | public void | registerFinishTask(Runnable task) Register a task to be done when the ObjectPlusFilesInputStream
is closed. | public void | restoreFile(File destination) Restore a file from storage, using the name and length
info on the serialization stream and the file from the
current auxiliary directory, to the given File. | public void | restoreFileTo(File directory) Restore a file from storage, using the name and length
info on the serialization stream and the file from the
current auxiliary directory, to the given File. |
ObjectPlusFilesInputStream | public ObjectPlusFilesInputStream(InputStream in, File storeDir) throws IOException(Code) | | Instantiate over the given stream and using the supplied
auxiliary storage directory.
Parameters: in - Parameters: storeDir - throws: IOException - |
getAuxiliaryDirectory | public File getAuxiliaryDirectory()(Code) | | Return the top auxiliary directory, from
which saved files are restored.
Auxillary directory. |
popAuxiliaryDirectory | public void popAuxiliaryDirectory()(Code) | | Discard the top auxiliary directory.
|
pushAuxiliaryDirectory | public void pushAuxiliaryDirectory(String dir)(Code) | | Push another default storage directory for use
until popped.
Parameters: dir - |
registerFinishTask | public void registerFinishTask(Runnable task)(Code) | | Register a task to be done when the ObjectPlusFilesInputStream
is closed.
Parameters: task - |
restoreFile | public void restoreFile(File destination) throws IOException(Code) | | Restore a file from storage, using the name and length
info on the serialization stream and the file from the
current auxiliary directory, to the given File.
Parameters: destination - throws: IOException - |
restoreFileTo | public void restoreFileTo(File directory) throws IOException(Code) | | Restore a file from storage, using the name and length
info on the serialization stream and the file from the
current auxiliary directory, to the given File.
Parameters: directory - throws: IOException - |
Methods inherited from java.io.ObjectInputStream | public int available() throws IOException(Code)(Java Doc) public void close() throws IOException(Code)(Java Doc) public void defaultReadObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected boolean enableResolveObject(boolean enable) throws SecurityException(Code)(Java Doc) public int read() throws IOException(Code)(Java Doc) public int read(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public boolean readBoolean() throws IOException(Code)(Java Doc) public byte readByte() throws IOException(Code)(Java Doc) public char readChar() throws IOException(Code)(Java Doc) protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException(Code)(Java Doc) public double readDouble() throws IOException(Code)(Java Doc) public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException(Code)(Java Doc) public float readFloat() throws IOException(Code)(Java Doc) public void readFully(byte[] buf) throws IOException(Code)(Java Doc) public void readFully(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public int readInt() throws IOException(Code)(Java Doc) public String readLine() throws IOException(Code)(Java Doc) public long readLong() throws IOException(Code)(Java Doc) final public Object readObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object readObjectOverride() throws IOException, ClassNotFoundException(Code)(Java Doc) public short readShort() throws IOException(Code)(Java Doc) protected void readStreamHeader() throws IOException, StreamCorruptedException(Code)(Java Doc) public String readUTF() throws IOException(Code)(Java Doc) public Object readUnshared() throws IOException, ClassNotFoundException(Code)(Java Doc) public int readUnsignedByte() throws IOException(Code)(Java Doc) public int readUnsignedShort() throws IOException(Code)(Java Doc) public void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException(Code)(Java Doc) protected Class> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object resolveObject(Object obj) throws IOException(Code)(Java Doc) protected Class> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException(Code)(Java Doc) public int skipBytes(int len) throws IOException(Code)(Java Doc)
|
|
|