erland.util
Class StreamStorage

java.lang.Object
  extended by erland.util.StreamStorage
All Implemented Interfaces:
StorageInterface

public class StreamStorage
extends Object
implements StorageInterface

Load and Save a string to a InputStream and OutputStream

Author:
Erland Isaksson

Constructor Summary
StreamStorage(InputStream input, OutputStream output)
          Creates a new FileStorage object
 
Method Summary
 String load()
          Reads data from stream
 void save(String data)
          Save the string to stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamStorage

public StreamStorage(InputStream input,
                     OutputStream output)
Creates a new FileStorage object

Parameters:
input - The InputStream that data should be read from, if null nothing will be read
output - The OutputStream that data should be written to, if null nothing will be written
Method Detail

load

public String load()
Reads data from stream

Specified by:
load in interface StorageInterface
Returns:
The string that was read from the stream

save

public void save(String data)
Save the string to stream.

Specified by:
save in interface StorageInterface
Parameters:
data - The string to store


Copyright © 2003-2005 Erland Isaksson. All Rights Reserved.