public class JniMemoryMappedFile extends RandomAccessStream
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeImpl()
Closes the stream.
|
protected void |
finalize() |
void |
flushToDisk() |
void |
fsync() |
long |
getFilePointer()
Returns the current position of the file pointer.
|
java.io.InputStream |
getInputStream()
Returns an InputStream for this stream.
|
long |
getLength()
Returns the length.
|
long |
getMmapAddress() |
java.io.OutputStream |
getOutputStream()
Returns an OutputStream for this stream.
|
static boolean |
isEnabled() |
boolean |
isMmap()
Returns true for mmap
|
static JniMemoryMappedFile |
open(Path path,
byte[] name,
int length,
long fileLength) |
int |
read()
Read a byte from the file, advancing the pointer.
|
int |
read(byte[] buf,
int offset,
int length)
Reads data from the file.
|
int |
read(char[] buf,
int offset,
int length)
Reads data from the file.
|
int |
read(long pos,
byte[] buf,
int offset,
int length)
Reads data from the file.
|
boolean |
seek(long position)
Seeks to the given position in the file.
|
java.lang.String |
toString()
Returns the debug name for the stream.
|
void |
write(byte[] buf,
int offset,
int length)
Writes data to the file.
|
void |
write(int b)
Write a byte to the file, advancing the pointer.
|
void |
write(long pos,
byte[] buf,
int offset,
int length)
Writes data to the file.
|
boolean |
writeToStream(SendfileOutputStream os,
long offset,
long length,
long[] blockAddresses,
long blockLength)
Writes data to the file.
|
allocate, close, free, getUseCount, isOpen, lock, unlockpublic static boolean isEnabled()
public static JniMemoryMappedFile open(Path path, byte[] name, int length, long fileLength)
public boolean isMmap()
isMmap in class RandomAccessStreampublic long getLength()
throws java.io.IOException
getLength in class RandomAccessStreamjava.io.IOExceptionpublic int read(long pos,
byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic long getMmapAddress()
getMmapAddress in class RandomAccessStreampublic void write(long pos,
byte[] buf,
int offset,
int length)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic boolean writeToStream(SendfileOutputStream os, long offset, long length, long[] blockAddresses, long blockLength) throws java.io.IOException
writeToStream in class RandomAccessStreamjava.io.IOExceptionpublic void fsync()
throws java.io.IOException
fsync in class RandomAccessStreamjava.io.IOExceptionpublic void flushToDisk()
throws java.io.IOException
java.io.IOExceptionpublic int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic int read(char[] buf,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic void write(byte[] buf,
int offset,
int length)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic boolean seek(long position)
seek in class RandomAccessStreampublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class RandomAccessStreamjava.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class RandomAccessStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
getFilePointer in class RandomAccessStreamjava.io.IOExceptionprotected void closeImpl()
throws java.io.IOException
RandomAccessStreamcloseImpl in class RandomAccessStreamjava.io.IOExceptionprotected void finalize()
throws java.io.IOException
finalize in class java.lang.Objectjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object