org.netbeans.mdr.persistence
Interface Streamable

All Known Implementing Classes:
Btree, BtreePage, org.netbeans.mdr.persistence.btreeimpl.btreestorage.NameIndex

public interface Streamable

Every implementation must provide a constructor without parameters. Cache should be able to populate the object using restore method.

Version:
1.0
Author:
Pavel Buzek

Method Summary
 void read(java.io.InputStream inputStream)
          Restore state of the Storable object from the stream.
 void write(java.io.OutputStream outputStream)
          This method will be used to move changed object from storage cache to the persistent part of storage.
 

Method Detail

write

public void write(java.io.OutputStream outputStream)
           throws StorageException
This method will be used to move changed object from storage cache to the persistent part of storage. It writes the object`s state (set of attributes) in the stream as an array of bytes, for example in textual representation.

Parameters:
outputStream - OutputStream that holds value of a Streamable object
Throws:
StorageException

read

public void read(java.io.InputStream inputStream)
          throws StorageException
Restore state of the Storable object from the stream.

Parameters:
inputStream - InputStream that represents an internal representation of fields of a Streamable object in which it was written by write method
Throws:
StorageException


Copyright © 2005 Apache Software Foundation. All Rights Reserved.