/** * Returns a thread-local ByteBuffer which references any memory address. The position is * set to zero, the limit and capacity are set to the given length. * * @throws UnsupportedOperationException if not supported */ public static ByteBuffer ref(long ptr, int length) { return ref(cLocalBuffer, ptr, length); }
private static int cipherDoFinal(Cipher cipher, long srcPage, int srcStart, int srcLen, long dstPage, int dstStart) throws GeneralSecurityException { return cipher.doFinal(DirectAccess.ref(srcPage + srcStart, srcLen), DirectAccess.ref2(dstPage + dstStart, srcLen)); } }
/** * Returns a second independent thread-local ByteBuffer. * * @throws UnsupportedOperationException if not supported */ public static ByteBuffer ref2(long ptr, int length) { return ref(cLocalBuffer2, ptr, length); }
public void writePage(long index, long ptr, int offset) throws IOException { writeCheck(index); ptr += offset; int pageSize = mPageSize; long dstPtr = mappingPtr() + index * pageSize; if (dstPtr != ptr) { ByteBuffer dst = DirectAccess.ref(dstPtr, pageSize); ByteBuffer src = DirectAccess.ref2(ptr, pageSize); dst.put(src); } }
/** * Returns an instance-specific thread-local ByteBuffer which references any memory * address. The position is set to zero, the limit and capacity are set to the given * length. * * @throws UnsupportedOperationException if not supported */ public ByteBuffer prepare(long ptr, int length) { return ref(mLocalBuffer, ptr, length); }
/** * Returns an instance-specific thread-local ByteBuffer which references any memory * address. The position is set to zero, the limit and capacity are set to the given * length. * * @throws UnsupportedOperationException if not supported */ public ByteBuffer prepare(long ptr, int length) { return ref(mLocalBuffer, ptr, length); }
/** * Returns a second independent thread-local ByteBuffer. * * @throws UnsupportedOperationException if not supported */ public static ByteBuffer ref2(long ptr, int length) { return ref(cLocalBuffer2, ptr, length); }
/** * Returns a second independent thread-local ByteBuffer. * * @throws UnsupportedOperationException if not supported */ public static ByteBuffer ref2(long ptr, int length) { return ref(cLocalBuffer2, ptr, length); }
/** * Returns an instance-specific thread-local ByteBuffer which references any memory * address. The position is set to zero, the limit and capacity are set to the given * length. * * @throws UnsupportedOperationException if not supported */ public ByteBuffer prepare(long ptr, int length) { return ref(mLocalBuffer, ptr, length); }
static int p_crc32(long srcPage, int srcStart, int len) { CRC32 crc = new CRC32(); crc.update(DirectAccess.ref(srcPage + srcStart, len)); return (int) crc.getValue(); } }
static int p_crc32(long srcPage, int srcStart, int len) { CRC32 crc = new CRC32(); crc.update(DirectAccess.ref(srcPage + srcStart, len)); return (int) crc.getValue(); } }
static int p_crc32(long srcPage, int srcStart, int len) { CRC32 crc = new CRC32(); crc.update(DirectAccess.ref(srcPage + srcStart, len)); return (int) crc.getValue(); } }
static void p_copyFromBB(ByteBuffer src, final long dstPage, int dstStart, int len) { src.limit(src.position() + len); DirectAccess.ref(dstPage + dstStart, len).put(src); src.limit(src.capacity()); }
static void p_copyFromBB(ByteBuffer src, final long dstPage, int dstStart, int len) { src.limit(src.position() + len); DirectAccess.ref(dstPage + dstStart, len).put(src); src.limit(src.capacity()); }
static void p_copyFromBB(ByteBuffer src, final long dstPage, int dstStart, int len) { src.limit(src.position() + len); DirectAccess.ref(dstPage + dstStart, len).put(src); src.limit(src.capacity()); }
private void access(boolean read, long pos, long ptr, int length) throws IOException { if (length > 0) { access(read, pos, DirectAccess.ref(ptr, length)); } }
private void access(boolean read, long pos, long ptr, int length) throws IOException { if (length > 0) { access(read, pos, DirectAccess.ref(ptr, length)); } }
private void access(boolean read, long pos, long ptr, int length) throws IOException { if (length > 0) { access(read, pos, DirectAccess.ref(ptr, length)); } }
public void writePage(long index, byte[] buf, int offset) throws IOException { writeCheck(index); int pageSize = mPageSize; DirectAccess.ref(mappingPtr() + index * pageSize, pageSize).put(buf, offset, pageSize); }
public void readPage(long index, byte[] buf, int offset, int length) throws IOException { readCheck(index); DirectAccess.ref(mappingPtr() + index * mPageSize, length).get(buf, offset, length); }