1

我想使用MappedByteBuffer.

try (FileChannel sourceChannel = new RandomAccessFile("sample.csv", "r").getChannel()) {
    MappedByteBuffer buf = sourceChannel.map(FileChannel.MapMode.READ_ONLY, 0, sourceChannel.size());
}

问题:

java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE
    at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:941)

我能在这里做什么?

4

0 回答 0