46 |
import java.io.RandomAccessFile; |
import java.io.RandomAccessFile; |
47 |
import java.nio.ByteBuffer; |
import java.nio.ByteBuffer; |
48 |
import java.nio.MappedByteBuffer; |
import java.nio.MappedByteBuffer; |
49 |
import java.nio.MappedByteFileBuffer; |
import java.nio.MappedByteBufferImpl; |
50 |
import java.nio.channels.ClosedChannelException; |
import java.nio.channels.ClosedChannelException; |
51 |
import java.nio.channels.FileChannel; |
import java.nio.channels.FileChannel; |
52 |
import java.nio.channels.FileLock; |
import java.nio.channels.FileLock; |
261 |
int cmode = mode.m; |
int cmode = mode.m; |
262 |
map_address = nio_mmap_file (position, size, cmode); |
map_address = nio_mmap_file (position, size, cmode); |
263 |
length = (int) size; |
length = (int) size; |
264 |
buf = new MappedByteFileBuffer (this); |
buf = new MappedByteBufferImpl (this); |
265 |
return buf; |
return buf; |
266 |
} |
} |
267 |
|
|
272 |
FileChannelImpl ch = new FileChannelImpl (); |
FileChannelImpl ch = new FileChannelImpl (); |
273 |
ch.map_address = map_address; |
ch.map_address = map_address; |
274 |
ch.length = (int) length; |
ch.length = (int) length; |
275 |
ch.buf = new MappedByteFileBuffer (ch); |
ch.buf = new MappedByteBufferImpl (ch); |
276 |
return ch.buf; |
return ch.buf; |
277 |
} |
} |
278 |
|
|