com.ados.hestia.utils.io
Class MemoryStore

java.lang.Object
  extended by com.ados.hestia.utils.io.MemoryStore
All Implemented Interfaces:
IStore, Serializable

public class MemoryStore
extends Object
implements IStore

This realize IStore interface using memory buffer to store data.
This is fast but at unconroling usage of it will cause MemoryException

Version:
$Revision: 1312 $ $Date: 2005-11-09 07:34:17 +0900 $
See Also:
IStore, Serialized Form

Nested Class Summary
 class MemoryStore.MemoryStoreOutStream
           
 
Field Summary
protected  byte[] m_data
           
protected  String m_id
           
 
Constructor Summary
MemoryStore(String id)
           
 
Method Summary
 OutputStream createStream()
          Create output stream to write data.
 String getID()
          Returns id of store.
 long getSize()
          Returns size of data at store.
 InputStream openSharedStream()
          Open shared stream to read data.
 InputStream openStream()
          Open ordinary stream to read data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_data

protected byte[] m_data

m_id

protected String m_id
Constructor Detail

MemoryStore

public MemoryStore(String id)
Method Detail

openStream

public InputStream openStream()
                       throws IOException
Open ordinary stream to read data.

Specified by:
openStream in interface IStore
Returns:
opened stream
Throws:
IOException - if stream can not be opened

openSharedStream

public InputStream openSharedStream()
                             throws IOException
Open shared stream to read data.

Specified by:
openSharedStream in interface IStore
Returns:
opened shared stream
Throws:
IOException - if stream can not be opened

createStream

public OutputStream createStream()
                          throws IOException
Create output stream to write data.

Specified by:
createStream in interface IStore
Returns:
create opened stream
Throws:
IOException - if stream can not be opened

getSize

public long getSize()
Returns size of data at store.

Specified by:
getSize in interface IStore
Returns:
size of data at store

getID

public String getID()
Returns id of store.

Specified by:
getID in interface IStore
Returns:
id of store.


Copyright © 2005-2006 ADOS Co.,Ltd.. All Rights Reserved.