public class RandomAccessStreamNio extends RandomAccessStream
Modifier and Type | Method and Description |
---|---|
protected void |
closeImpl()
Closes the stream.
|
protected void |
finalize() |
void |
flushToDisk() |
void |
fsync()
Writes data to the file.
|
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.
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream for this stream.
|
boolean |
isMmap()
Returns true for mmap
|
static RandomAccessStreamNio |
open(Path path,
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.
|
allocate, close, free, getMmapAddress, getUseCount, isOpen, lock, unlock, writeToStream
public static RandomAccessStreamNio open(Path path, long fileLength) throws java.io.IOException
java.io.IOException
public boolean isMmap()
isMmap
in class RandomAccessStream
public long getLength() throws java.io.IOException
getLength
in class RandomAccessStream
java.io.IOException
public int read(long pos, byte[] buf, int offset, int length) throws java.io.IOException
read
in class RandomAccessStream
java.io.IOException
public void write(long pos, byte[] buf, int offset, int length) throws java.io.IOException
write
in class RandomAccessStream
java.io.IOException
public void fsync() throws java.io.IOException
fsync
in class RandomAccessStream
java.io.IOException
public void flushToDisk() throws java.io.IOException
java.io.IOException
public int read(byte[] buf, int offset, int length) throws java.io.IOException
read
in class RandomAccessStream
java.io.IOException
public int read(char[] buf, int offset, int length) throws java.io.IOException
read
in class RandomAccessStream
java.io.IOException
public void write(byte[] buf, int offset, int length) throws java.io.IOException
write
in class RandomAccessStream
java.io.IOException
public boolean seek(long position)
seek
in class RandomAccessStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class RandomAccessStream
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class RandomAccessStream
java.io.IOException
public int read() throws java.io.IOException
read
in class RandomAccessStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class RandomAccessStream
java.io.IOException
public long getFilePointer() throws java.io.IOException
getFilePointer
in class RandomAccessStream
java.io.IOException
protected void closeImpl() throws java.io.IOException
RandomAccessStream
closeImpl
in class RandomAccessStream
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object