public abstract class AbstractDataAccess extends Object implements DataAccess
Modifier and Type | Field and Description |
---|---|
protected BitUtil |
bitUtil |
protected ByteOrder |
byteOrder |
protected boolean |
closed |
protected static byte[] |
EMPTY |
protected int[] |
header |
protected static int |
HEADER_OFFSET |
protected int |
indexDivisor |
protected String |
name |
protected static int |
SEGMENT_SIZE_MIN |
protected int |
segmentSizeInBytes |
protected int |
segmentSizePower |
Constructor and Description |
---|
AbstractDataAccess(String name,
String location,
int segmentSize) |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method makes sure that the underlying used resources are released.
|
protected void |
copyHeader(DataAccess da) |
protected String |
getFullName() |
int |
getHeader(int bytePos)
Get 4 bytes from the header at 'index'
|
String |
getName()
The logical identification of this object.
|
int |
getSegmentSize() |
boolean |
isClosed() |
protected boolean |
isIntBased() |
boolean |
isStoring() |
protected long |
readHeader(RandomAccessFile raFile) |
void |
setHeader(int bytePos,
int value)
Set 4 bytes at the header space index to the specified value
|
String |
toString() |
protected void |
writeHeader(RandomAccessFile file,
long length,
int segmentSize)
Writes some internal data into the beginning of the specified file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
create, ensureCapacity, flush, getByte, getBytes, getCapacity, getInt, getSegments, getShort, getType, loadExisting, setByte, setBytes, setInt, setShort
protected static final int SEGMENT_SIZE_MIN
protected static final int HEADER_OFFSET
protected static final byte[] EMPTY
protected final ByteOrder byteOrder
protected final BitUtil bitUtil
protected int[] header
protected String name
protected int segmentSizeInBytes
protected int segmentSizePower
protected int indexDivisor
protected boolean closed
public String getName()
DataAccess
getName
in interface DataAccess
protected String getFullName()
public void close()
DataAccess
close
in interface DataAccess
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
isClosed
in interface DataAccess
public void setHeader(int bytePos, int value)
DataAccess
setHeader
in interface DataAccess
public int getHeader(int bytePos)
DataAccess
getHeader
in interface DataAccess
protected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException
IOException
protected long readHeader(RandomAccessFile raFile) throws IOException
IOException
protected void copyHeader(DataAccess da)
public int getSegmentSize()
getSegmentSize
in interface DataAccess
public boolean isStoring()
protected boolean isIntBased()
Copyright © 2012–2022. All rights reserved.