com.crankuptheamps.client
Class MemoryStoreBuffer

java.lang.Object
  extended by com.crankuptheamps.client.MemoryStoreBuffer
All Implemented Interfaces:
BlockPublishStore.Buffer

public class MemoryStoreBuffer
extends Object
implements BlockPublishStore.Buffer


Field Summary
protected  ByteBuffer _buffer
           
protected  PublishStoreResizeHandler _resizeHandler
           
protected  Store _store
           
 
Constructor Summary
MemoryStoreBuffer()
           
 
Method Summary
 byte getByte()
           
 void getBytes(BlockPublishStore.ByteSequence outBytes)
           
 int getInt()
           
 long getLong()
           
 long getPosition()
           
 long getSize()
           
 void putByte(byte b)
           
 void putBytes(BlockPublishStore.ByteSequence bytes)
           
 void putInt(int i)
           
 void putLong(long l)
           
 void setPosition(long position)
           
 void setResizeHandler(PublishStoreResizeHandler handler, Store store)
           
 void setSize(long newSize)
           
 void zero(long offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_buffer

protected ByteBuffer _buffer

_resizeHandler

protected PublishStoreResizeHandler _resizeHandler

_store

protected Store _store
Constructor Detail

MemoryStoreBuffer

public MemoryStoreBuffer()
Method Detail

getSize

public long getSize()
             throws IOException
Specified by:
getSize in interface BlockPublishStore.Buffer
Throws:
IOException

setSize

public void setSize(long newSize)
             throws IOException
Specified by:
setSize in interface BlockPublishStore.Buffer
Throws:
IOException

getPosition

public long getPosition()
                 throws IOException
Specified by:
getPosition in interface BlockPublishStore.Buffer
Throws:
IOException

setPosition

public void setPosition(long position)
                 throws IOException
Specified by:
setPosition in interface BlockPublishStore.Buffer
Throws:
IOException

putByte

public void putByte(byte b)
             throws IOException
Specified by:
putByte in interface BlockPublishStore.Buffer
Throws:
IOException

getByte

public byte getByte()
             throws IOException
Specified by:
getByte in interface BlockPublishStore.Buffer
Throws:
IOException

putInt

public void putInt(int i)
            throws IOException
Specified by:
putInt in interface BlockPublishStore.Buffer
Throws:
IOException

getInt

public int getInt()
           throws IOException
Specified by:
getInt in interface BlockPublishStore.Buffer
Throws:
IOException

putLong

public void putLong(long l)
             throws IOException
Specified by:
putLong in interface BlockPublishStore.Buffer
Throws:
IOException

getLong

public long getLong()
             throws IOException
Specified by:
getLong in interface BlockPublishStore.Buffer
Throws:
IOException

putBytes

public void putBytes(BlockPublishStore.ByteSequence bytes)
              throws IOException
Specified by:
putBytes in interface BlockPublishStore.Buffer
Throws:
IOException

getBytes

public void getBytes(BlockPublishStore.ByteSequence outBytes)
              throws IOException
Specified by:
getBytes in interface BlockPublishStore.Buffer
Throws:
IOException

zero

public void zero(long offset,
                 int length)
          throws IOException
Specified by:
zero in interface BlockPublishStore.Buffer
Throws:
IOException

setResizeHandler

public void setResizeHandler(PublishStoreResizeHandler handler,
                             Store store)
Specified by:
setResizeHandler in interface BlockPublishStore.Buffer