public interface SequentialFile
Modifier and Type | Method and Description |
---|---|
static long |
appendTo(Path src,
Path dst) |
void |
blockingWriteDirect(ByteBuffer bytes,
boolean sync,
boolean releaseBuffer)
Write directly to the file without using any intermediate buffer and wait completion.
If releaseBuffer is true the provided bytes should be released
through SequentialFileFactory.releaseBuffer(ByteBuffer) , if supported. |
int |
calculateBlockStart(int position) |
SequentialFile |
cloneFile() |
void |
close() |
default void |
close(boolean waitSync)
When closing a file from a finalize block, you cant wait on syncs or anything like that.
|
void |
copyTo(SequentialFile newFileName) |
void |
delete() |
boolean |
exists() |
void |
fill(int size) |
boolean |
fits(int size) |
String |
getFileName() |
File |
getJavaFile()
Returns a native File of the file underlying this sequential file.
|
boolean |
isOpen() |
void |
open() |
void |
open(int maxIO,
boolean useExecutor)
The maximum number of simultaneous writes accepted
|
long |
position() |
void |
position(long pos) |
int |
read(ByteBuffer bytes) |
int |
read(ByteBuffer bytes,
IOCallback callback) |
void |
renameTo(String newFileName) |
void |
setTimedBuffer(TimedBuffer buffer) |
long |
size() |
void |
sync() |
void |
write(ActiveMQBuffer bytes,
boolean sync) |
void |
write(ActiveMQBuffer bytes,
boolean sync,
IOCallback callback) |
void |
write(EncodingSupport bytes,
boolean sync) |
void |
write(EncodingSupport bytes,
boolean sync,
IOCallback callback) |
void |
writeDirect(ByteBuffer bytes,
boolean sync)
Write directly to the file without using intermediate any buffer
|
void |
writeDirect(ByteBuffer bytes,
boolean sync,
IOCallback callback)
Write directly to the file without using any buffer
|
boolean isOpen()
boolean exists()
void open(int maxIO, boolean useExecutor) throws Exception
maxIO
- Exception
boolean fits(int size)
String getFileName()
void delete() throws IOException, InterruptedException, ActiveMQException
void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback) throws Exception
Exception
void write(ActiveMQBuffer bytes, boolean sync) throws Exception
Exception
void write(EncodingSupport bytes, boolean sync, IOCallback callback) throws Exception
Exception
void write(EncodingSupport bytes, boolean sync) throws Exception
Exception
void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback)
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.Exception
void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception
releaseBuffer
is true
the provided bytes
should be released
through SequentialFileFactory.releaseBuffer(ByteBuffer)
, if supported.bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). If releaseBuffer
is true
use a buffer from
SequentialFileFactory.newBuffer(int)
, SequentialFileFactory.allocateDirectBuffer(int)
otherwise.sync
- if true
will durable flush the written data on the file, false
otherwisereleaseBuffer
- if true
will release the buffer, false
otherwiseException
int read(ByteBuffer bytes, IOCallback callback) throws Exception
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.Exception
int read(ByteBuffer bytes) throws Exception
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.Exception
void position(long pos) throws IOException
IOException
long position()
default void close(boolean waitSync) throws Exception
Exception
void sync() throws IOException
IOException
SequentialFile cloneFile()
void copyTo(SequentialFile newFileName) throws Exception
Exception
void setTimedBuffer(TimedBuffer buffer)
File getJavaFile()
static long appendTo(Path src, Path dst) throws IOException
IOException
Copyright © 2019 JBoss by Red Hat. All rights reserved.