public class MappedMemory extends Object implements ReferenceCounted, BytesStore
Constructor and Description |
---|
MappedMemory(MappedByteBuffer buffer,
long index) |
Modifier and Type | Method and Description |
---|---|
long |
address() |
MappedByteBuffer |
buffer() |
Bytes |
bytes()
Create a bytes whose content is the whole bytes store.
|
Bytes |
bytes(long offset,
long length)
|
void |
close() |
File |
file() |
void |
force() |
void |
free() |
long |
index() |
ObjectSerializer |
objectSerializer() |
int |
refCount() |
boolean |
release() |
static void |
release(MappedMemory mapmem) |
void |
reserve() |
long |
size() |
public MappedMemory(MappedByteBuffer buffer, long index)
public static void release(MappedMemory mapmem)
public long index()
public void reserve()
reserve
in interface ReferenceCounted
public boolean release()
release
in interface ReferenceCounted
public int refCount()
refCount
in interface ReferenceCounted
public MappedByteBuffer buffer()
public long address()
address
in interface BytesStore
public long size()
size
in interface BytesStore
public void free()
free
in interface BytesStore
public ObjectSerializer objectSerializer()
objectSerializer
in interface BytesStore
public File file()
file
in interface BytesStore
public Bytes bytes()
BytesStore
bytes(0, size())
call.bytes
in interface BytesStore
BytesStore.bytes(long, long)
public Bytes bytes(long offset, long length)
BytesStore
Bytes
object with start address of
address
+ offset
and capacity of length
.
If this BytesStore
is Bytes
itself rather than natural
BytesStore
object, this method will offset the new bytes from the
bytes' start, not from bytes' position like
BytesCommon.slice(long, long)
.
offset
should be non-negative, length
should be positive,
offset + length
should be less or equal to size
.
bytes
in interface BytesStore
offset
- offset of the new bytes from the bytes store addresslength
- capacity and limit of the new bytesBytes
BytesStore.bytes()
public void force()
public void close()
Copyright © 2019. All rights reserved.