| Modifier and Type | Field and Description |
|---|---|
| private final FileChannel | |
| private ByteBuffer | |
| private final long | |
| private final Consumer |
| Access | Constructor and Description |
|---|---|
| public | RandomAccessReadMemoryMappedFile(String
the filename of the file to be read filename)Create a random access memory mapped file instance for the file with the given name. |
| public | RandomAccessReadMemoryMappedFile(File
the file to be read file)Create a random access memory mapped file instance for the given file. |
| public | RandomAccessReadMemoryMappedFile(Path
path of the file to be read. path)Create a random access memory mapped file instance using the given path. |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public RandomAccessReadView | createView(long
start position within the underlying random access read startPosition, long stream length streamLength)Implements org. Creates a random access read view starting at the given position with the given length. |
| public long | getPosition()
Implements org. Returns offset of next byte to be returned by a read method. |
| public boolean | isClosed()
Implements org. Returns true if this source has been closed. |
| public boolean | isEOF()
Implements org. A simple test to see if we are at the end of the data. |
| public long | length()
Implements org. The total number of bytes that are available. |
| public int | |
| public int | read(byte[]
The buffer to write the data to. b, int Offset into the buffer to start writing. offset, int The amount of data to attempt to read. length)Implements org. Read a buffer of data. |
| public void | seek(long
The position to seek to. position)Implements org. Seek to a position in the data. |
| fileChannel | back to summary |
|---|---|
| private final FileChannel fileChannel | |
| mappedByteBuffer | back to summary |
|---|---|
| private ByteBuffer mappedByteBuffer | |
| size | back to summary |
|---|---|
| private final long size | |
| unmapper | back to summary |
|---|---|
| private final Consumer<? super ByteBuffer> unmapper | |
| RandomAccessReadMemoryMappedFile | back to summary |
|---|---|
| public RandomAccessReadMemoryMappedFile(String filename) throws IOException Create a random access memory mapped file instance for the file with the given name.
| |
| RandomAccessReadMemoryMappedFile | back to summary |
|---|---|
| public RandomAccessReadMemoryMappedFile(File file) throws IOException Create a random access memory mapped file instance for the given file.
| |
| RandomAccessReadMemoryMappedFile | back to summary |
|---|---|
| public RandomAccessReadMemoryMappedFile(Path path) throws IOException Create a random access memory mapped file instance using the given path.
| |
| RandomAccessReadMemoryMappedFile | back to summary |
|---|---|
| private RandomAccessReadMemoryMappedFile(RandomAccessReadMemoryMappedFile parent) | |
| checkClosed | back to summary |
|---|---|
| private void checkClosed() throws IOException Ensure that the RandomAccessReadMemoryMappedFile is not closed
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| createView | back to summary |
|---|---|
| public RandomAccessReadView createView(long startPosition, long streamLength) Implements org. Doc from org. Creates a random access read view starting at the given position with the given length.
| |
| getPosition | back to summary |
|---|---|
| public long getPosition() throws IOException Implements org. Doc from org. Returns offset of next byte to be returned by a read method.
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements org. Doc from org. Returns true if this source has been closed.
| |
| isEOF | back to summary |
|---|---|
| public boolean isEOF() throws IOException Implements org. Doc from org. A simple test to see if we are at the end of the data.
| |
| length | back to summary |
|---|---|
| public long length() throws IOException Implements org. Doc from org. The total number of bytes that are available.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements org. Doc from org. Read a single byte of data.
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int offset, int length) throws IOException Implements org. Doc from org. Read a buffer of data.
| |
| seek | back to summary |
|---|---|
| public void seek(long position) throws IOException Implements org. Doc from org. Seek to a position in the data.
| |