public final class MMapDataAccess extends AbstractDataAccess
bitUtil, byteOrder, closed, EMPTY, header, HEADER_OFFSET, indexDivisor, name, SEGMENT_SIZE_MIN, segmentSizeInBytes, segmentSizePower
Modifier and Type | Method and Description |
---|---|
void |
close()
This method makes sure that the underlying used resources are released.
|
DataAccess |
copyTo(DataAccess da)
Copies the content from this object into the specified one.
|
MMapDataAccess |
create(long bytes)
The first time you use a DataAccess object after configuring it you need to call this method.
|
boolean |
ensureCapacity(long bytes)
Ensures that the capacity of this object is at least the specified bytes.
|
void |
flush()
This method makes sure that the underlying data is written to the storage.
|
void |
getBytes(long bytePos,
byte[] values,
int length)
Get bytes from position 'index'
|
long |
getCapacity() |
int |
getInt(long bytePos)
Get 4 bytes from position 'bytePos'
|
int |
getSegments() |
short |
getShort(long bytePos)
Get 2 bytes from position 'index'
|
DAType |
getType() |
boolean |
loadExisting() |
void |
rename(String newName)
Renames the underlying DataAccess object.
|
void |
setBytes(long bytePos,
byte[] values,
int length)
Set bytes from position 'index' to the specified values
|
void |
setInt(long bytePos,
int value)
Set 4 bytes at position 'bytePos' to the specified value
|
void |
setShort(long bytePos,
short value)
Set 2 bytes at position 'index' to the specified value
|
void |
trimTo(long capacity)
Reduces the allocate space to the specified bytes.
|
checkBeforeRename, copyHeader, getFullName, getHeader, getName, getSegmentSize, isClosed, isIntBased, isStoring, readHeader, setHeader, setSegmentSize, toString, writeHeader
public MMapDataAccess create(long bytes)
DataAccess
public DataAccess copyTo(DataAccess da)
DataAccess
copyTo
in interface DataAccess
copyTo
in class AbstractDataAccess
public boolean ensureCapacity(long bytes)
DataAccess
DataAccess.create(long)
public boolean loadExisting()
public void flush()
Storable
public void close()
Storable
close
in interface Storable<DataAccess>
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractDataAccess
public final void setInt(long bytePos, int value)
DataAccess
public final int getInt(long bytePos)
DataAccess
public final void setShort(long bytePos, short value)
DataAccess
public final short getShort(long bytePos)
DataAccess
public void setBytes(long bytePos, byte[] values, int length)
DataAccess
public void getBytes(long bytePos, byte[] values, int length)
DataAccess
values
- acts as outputpublic long getCapacity()
public int getSegments()
public void trimTo(long capacity)
DataAccess
public void rename(String newName)
DataAccess
rename
in interface DataAccess
rename
in class AbstractDataAccess
public DAType getType()
Copyright © 2012–2018. All rights reserved.