org.encog.persist.location
Class InputStreamPersistence

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

public class InputStreamPersistence
extends Object
implements PersistenceLocation

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


Constructor Summary
InputStreamPersistence(InputStream istream)
          Construct this location.
 
Method Summary
 InputStream createInputStream()
          Create the input stream.
 OutputStream createOutputStream()
          Try to create an output stream.
 void delete()
          Delete operations are not supported for resource persistence.
 boolean exists()
          Because this is based on a stream, it always exists, so return true.
 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

InputStreamPersistence

public InputStreamPersistence(InputStream istream)
Construct this location.

Parameters:
istream - The input stream to use.
Method Detail

createInputStream

public InputStream createInputStream()
Create the input stream.

Specified by:
createInputStream in interface PersistenceLocation
Returns:
The input stream.

createOutputStream

public OutputStream createOutputStream()
Try to create an output stream. This will fail, as output streams are not supported by this location type.

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

delete

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

Specified by:
delete in interface PersistenceLocation

exists

public boolean exists()
Because this is based on a stream, it always exists, so return true.

Specified by:
exists in interface PersistenceLocation
Returns:
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.