Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for your answer mdma! I'm just wondering, how can I be sure that array() will work? The Javadoc says "Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array." And allocateDirect() tells me "Whether or not it has a backing array is unspecified." I wonder if that wil work?
      singulars
    2. COThat's the rub with some of the more platform-dependent features, it's VM dependent. You could catch the Excption thrown by array() and obtain the array using ByteBuffer.get(byte[]) as a fallback. If you really direct access for all VMs, you could code a small JNI stub method that takes the direct ByteBuffer instance, and calls GetDirectByteBufferAddress, which you then forward to your original JNI method. If the ByteBuffer has to copy the data once to a new array, it's going to be quick - these are optimized methods, and much quicker than reading a file piecemeal into a byte[].
      singulars
    3. COOne other point that may help your performance - use multi-threading. Even though your app is going to be I/O bound, the I/O will block waiting for data (e.g. non-contiguous files.) Having several threads reading different files simultaneously will give you a speedup, especially using async I/O. The ForkJoin framework (JSR 166) is really useful for this kind of work, and very easy to use: Refactor the file operation as a Task. Create a Task for each file you want to process, and put them all in the task queue. The task queue then runs these tasks at the level of parallelism you specify.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload