org.encog.persist.location
Class OutputStreamPersistence

java.lang.Object
  extended by org.encog.persist.location.OutputStreamPersistence
All Implemented Interfaces:
PersistenceLocation

public class OutputStreamPersistence
extends Object
implements PersistenceLocation

This class allows Encog persistence to use a location that is based on an OutputStream.


Constructor Summary
OutputStreamPersistence(OutputStream ostream)
          Construct the output stream location.
 
Method Summary
 InputStream createInputStream()
          Can't create an InputStream for this object type, throw an error.
 OutputStream createOutputStream()
          Provide the output stream to use.
 void delete()
          Delete operations are not supported for resource persistence.
 boolean exists()
           
 void renameTo(PersistenceLocation toLocation)
          Renames are not allowed on this type of location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamPersistence

public OutputStreamPersistence(OutputStream ostream)
Construct the output stream location.

Parameters:
ostream - The OutputStream to base this on.
Method Detail

createInputStream

public InputStream createInputStream()
Can't create an InputStream for this object type, throw an error.

Specified by:
createInputStream in interface PersistenceLocation
Returns:
Not used.

createOutputStream

public OutputStream createOutputStream()
Provide the output stream to use.

Specified by:
createOutputStream in interface PersistenceLocation
Returns:
The output stream.

delete

public void delete()
Delete operations are not supported for resource persistence.

Specified by:
delete in interface PersistenceLocation

exists

public boolean exists()
Specified by:
exists in interface PersistenceLocation
Returns:
Because this is based on a stream, it always exists, so return true.

renameTo

public void renameTo(PersistenceLocation toLocation)
Renames are not allowed on this type of location.

Specified by:
renameTo in interface PersistenceLocation
Parameters:
toLocation - Not used.


Copyright © 2011. All Rights Reserved.