com.gc.iotools.stream.store
Class ThresholdStore

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

public class ThresholdStore
extends Object
implements SeekableStore

Since:
1.2.0
Author:
dvd.smnt

Constructor Summary
ThresholdStore(int treshold)
           
ThresholdStore(int treshold, File file)
           
 
Method Summary
 void cleanup()
          Cleans up the Store.
protected  void finalize()
          Clean up the temporary files eventually open.
 int get(byte[] bytes, int offset, int length)
           
 long getSize()
           
 int getTreshold()
           
 void put(byte[] bytes, int offset, int length)
           
 void seek(long position)
          Reposition this Store on a previously read position.
 void setPosition(long 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThresholdStore

public ThresholdStore(int treshold)

ThresholdStore

public ThresholdStore(int treshold,
                      File file)
Method Detail

getTreshold

public int getTreshold()

getSize

public long getSize()

setPosition

public void setPosition(long position)

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)
        throws IOException
Specified by:
get in interface Store
Throws:
IOException

put

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

seek

public void seek(long position)
          throws IOException
Reposition this Store on a previously read position.

Specified by:
seek in interface SeekableStore
Parameters:
position - position to read the data from.
Throws:
IOException - is thrown if some (disk) error happens or a seek over the buffer length is requested.

finalize

protected void finalize()
                 throws Throwable
Clean up the temporary files eventually open.

Overrides:
finalize in class Object
Throws:
Throwable

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.