एंड्रॉइड के तहत कोई हैक उपलब्ध नहीं है।
लेकिन वहाँ कुछ सहायकों और स्निपेट जो सी-जावा mmap आसान फ़ाइलों के लिए बाध्यकारी कर रहे हैं/आसान:
कार्रवाई में util-mmap देखें हटाएँ:
public class MMapTesting {
public static void main(String[] args) throws IOException {
File file = new File("test");
MMapBuffer buffer = new MMapBuffer(file, 0, 1000, FileChannel.MapMode.READ_WRITE, ByteOrder.BIG_ENDIAN)) {
buffer.memory().intArray(0, 100).set(2, 234);
// calls unmap under the hood
buffer.close();
// here we call unmap automatically at the end of this try-resource block
try (MMapBuffer buffer = new MMapBuffer(file, FileChannel.MapMode.READ_WRITE, ByteOrder.BIG_ENDIAN)) {
System.out.println("length: " + buffer.memory().length());
IntArray arr = buffer.memory().intArray(0, buffer.memory().length()/8);
// prints 234
System.out.println(arr.get(2));
}
}
}
यहाँ इस सवाल का कारण है: http: //stackoverflow.com/questions/38293892/java-mmap-fails-on-android-with-mmap-failed-enomem-out-of-memory – Karussell