Package com.mckoi.store
Class AbstractStore.StoreArea
- java.lang.Object
-
- com.mckoi.store.AbstractStore.StoreArea
-
- All Implemented Interfaces:
Area
- Direct Known Subclasses:
AbstractStore.StoreMutableArea
- Enclosing class:
- AbstractStore
private class AbstractStore.StoreArea extends java.lang.Object implements Area
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]bufferprotected static intBUFFER_SIZEprotected longend_pointerprotected longidprotected longpositionprotected longstart_pointer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcapacity()Returns the capacity of the area.protected longcheckPositionBounds(int diff)voidcopyTo(AreaWriter destination_writer, int size)Copies 'size' bytes from the current position of this Area to the destination AreaWriter.byteget()voidget(byte[] buf, int off, int len)chargetChar()longgetID()Returns the unique identifier that represents this area.intgetInt()longgetLong()shortgetShort()intposition()Returns the current position of the pointer within the area.voidposition(int position)Sets the position within the area.java.lang.StringtoString()
-
-
-
Field Detail
-
BUFFER_SIZE
protected static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
id
protected final long id
-
start_pointer
protected final long start_pointer
-
end_pointer
protected final long end_pointer
-
position
protected long position
-
buffer
protected final byte[] buffer
-
-
Method Detail
-
checkPositionBounds
protected long checkPositionBounds(int diff) throws java.io.IOException- Throws:
java.io.IOException
-
getID
public long getID()
Description copied from interface:AreaReturns the unique identifier that represents this area.
-
position
public int position()
Description copied from interface:AreaReturns the current position of the pointer within the area. The position starts at beginning of the area.
-
capacity
public int capacity()
Description copied from interface:AreaReturns the capacity of the area.
-
position
public void position(int position) throws java.io.IOExceptionDescription copied from interface:AreaSets the position within the area.
-
copyTo
public void copyTo(AreaWriter destination_writer, int size) throws java.io.IOException
Description copied from interface:AreaCopies 'size' bytes from the current position of this Area to the destination AreaWriter.
-
get
public byte get() throws java.io.IOException
-
get
public void get(byte[] buf, int off, int len) throws java.io.IOException
-
getShort
public short getShort() throws java.io.IOException
-
getInt
public int getInt() throws java.io.IOException
-
getLong
public long getLong() throws java.io.IOException
-
getChar
public char getChar() throws java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-