public class MappedBytes extends ByteBufferBytes
ByteBuffer based mapped bytes.| Modifier and Type | Method and Description |
|---|---|
static MappedBytes |
allocate(File file,
FileChannel.MapMode mode,
int size)
Allocates a mapped buffer.
|
static MappedBytes |
allocate(File file,
int size)
Allocates a mapped buffer in
FileChannel.MapMode#READ_WRITE mode. |
void |
close() |
void |
delete()
Deletes the underlying file.
|
Bytes |
flush()
Flushes the bytes to the underlying persistence layer.
|
boolean |
isDirect()
Returns a boolean value indicating whether the bytes are direct.
|
array, byteBuffer, order, order, read, read, readByte, readChar, readDouble, readFloat, readInt, readLong, readShort, reset, resize, size, write, write, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeShort, zero, zero, zeroisFile, readBoolean, readMedium, readString, readString, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, readUTF8, writeBoolean, writeMedium, writeString, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedMedium, writeUnsignedShort, writeUTF8public static MappedBytes allocate(File file, int size)
FileChannel.MapMode#READ_WRITE mode.
Memory will be mapped by opening and expanding the given File to the desired count and mapping the
file contents into memory via FileChannel.map(FileChannel.MapMode, long, long).
file - The file to map into memory. If the file doesn't exist it will be automatically created.size - The count of the buffer to allocate (in bytes).NullPointerException - If file is nullIllegalArgumentException - If count is greater than MappedMemory.MAX_SIZEallocate(File, FileChannel.MapMode, int)public static MappedBytes allocate(File file, FileChannel.MapMode mode, int size)
Memory will be mapped by opening and expanding the given File to the desired count and mapping the
file contents into memory via FileChannel.map(FileChannel.MapMode, long, long).
file - The file to map into memory. If the file doesn't exist it will be automatically created.mode - The mode with which to map the file.size - The count of the buffer to allocate (in bytes).NullPointerException - If file is nullIllegalArgumentException - If count is greater than Integer.MAX_VALUEallocate(File, int)public boolean isDirect()
BytesisDirect in interface BytesisDirect in class AbstractBytespublic Bytes flush()
BytesOutputflush in interface BytesOutput<Bytes>flush in class AbstractBytespublic void close()
close in interface Bytesclose in interface AutoCloseableclose in class AbstractBytespublic void delete()
Copyright © 2013–2018. All rights reserved.