com.gc.iotools.stream.store
Class MemoryStore

java.lang.Object
  extended by com.gc.iotools.stream.store.MemoryStore
All Implemented Interfaces:
SeekableStore, Store

public class MemoryStore
extends Object
implements SeekableStore

TODO: more efficient memory usage.

Since:
1.2.0
Author:
dvd.smnt

Constructor Summary
MemoryStore()
           
 
Method Summary
 void cleanup()
          Cleans up the Store.
 int get(byte[] bytes, int offset, int length)
           
 long getPosition()
           
 void put(byte[] bytes, int offset, int length)
           
 void seek(long position)
          Reposition this Store on a previously read position.
 String toString()
          Provides a String representation of the state of the Store for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemoryStore

public MemoryStore()
Method Detail

getPosition

public long getPosition()

cleanup

public void cleanup()
Description copied from interface: Store
Cleans up the Store. Forget all the data previously stored.

Specified by:
cleanup in interface Store

get

public int get(byte[] bytes,
               int offset,
               int length)
Specified by:
get in interface Store

put

public void put(byte[] bytes,
                int offset,
                int length)
Specified by:
put in interface Store

seek

public void seek(long position)
Description copied from interface: SeekableStore
Reposition this Store on a previously read position.

Specified by:
seek in interface SeekableStore
Parameters:
position - position to read the data from.

toString

public String toString()
Provides a String representation of the state of the Store for debugging purposes.

Overrides:
toString in class Object


Copyright © 2008-2009. All Rights Reserved.