Package org.ujmp.core.util.io
Class WeakMappedByteBuffer
java.lang.Object
org.ujmp.core.util.io.WeakMappedByteBuffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate WeakReference<ByteBuffer>
static final int
private final FileChannel
private final FileChannel.MapMode
private final long
private final long
-
Constructor Summary
ConstructorsConstructorDescriptionWeakMappedByteBuffer
(FileChannel fileChannel, FileChannel.MapMode mapMode, long pos, int size) -
Method Summary
Modifier and TypeMethodDescriptionlong
capacity()
compact()
static final WeakMappedByteBuffer[]
create
(RandomAccessFile randomAccessFile) byte
get()
void
get
(byte[] dst, int offset, int length) byte
get
(int index) char
getChar()
char
getChar
(int index) double
double
getDouble
(int index) float
getFloat()
float
getFloat
(int index) int
getInt()
int
getInt
(int index) long
getLong()
long
getLong
(int index) short
getShort()
short
getShort
(int index) boolean
isDirect()
boolean
void
position
(int offset) put
(byte b) void
put
(byte[] bytes, int offset, int length) put
(int index, byte b) putChar
(char value) putChar
(int index, char value) putDouble
(double value) putDouble
(int index, double value) putFloat
(float value) putFloat
(int index, float value) putInt
(int value) putInt
(int index, int value) putLong
(int index, long value) putLong
(long value) putShort
(int index, short value) putShort
(short value) reset()
rewind()
slice()
-
Field Details
-
DEFAULTBUFFERSIZE
public static final int DEFAULTBUFFERSIZE- See Also:
-
byteBufferReference
-
fileChannel
-
mapMode
-
pos
private final long pos -
size
private final long size
-
-
Constructor Details
-
WeakMappedByteBuffer
public WeakMappedByteBuffer(FileChannel fileChannel, FileChannel.MapMode mapMode, long pos, int size)
-
-
Method Details
-
create
public static final WeakMappedByteBuffer[] create(RandomAccessFile randomAccessFile) throws IOException - Throws:
IOException
-
getOrCreateByteBuffer
-
slice
-
duplicate
-
asReadOnlyBuffer
-
get
public byte get() -
put
-
get
public byte get(int index) -
put
-
compact
-
isDirect
public boolean isDirect() -
getChar
public char getChar() -
putChar
-
getChar
public char getChar(int index) -
putChar
-
asCharBuffer
-
getShort
public short getShort() -
putShort
-
getShort
public short getShort(int index) -
putShort
-
asShortBuffer
-
getInt
public int getInt() -
putInt
-
getInt
public int getInt(int index) -
putInt
-
asIntBuffer
-
getLong
public long getLong() -
putLong
-
getLong
public long getLong(int index) -
putLong
-
asLongBuffer
-
getFloat
public float getFloat() -
putFloat
-
getFloat
public float getFloat(int index) -
putFloat
-
asFloatBuffer
-
getDouble
public double getDouble() -
putDouble
-
getDouble
public double getDouble(int index) -
putDouble
-
asDoubleBuffer
-
isReadOnly
public boolean isReadOnly() -
capacity
public long capacity() -
position
public void position(int offset) -
put
public void put(byte[] bytes, int offset, int length) -
get
public void get(byte[] dst, int offset, int length) -
rewind
-
reset
-