public class AIOSequentialFile extends AbstractSequentialFile implements IOExceptionListener
AbstractSequentialFile.DelegateCallback, AbstractSequentialFile.LocalBufferObserverfactory, fileSize, position, timedBuffer, timedBufferObserver, writerExecutor| Constructor and Description |
|---|
AIOSequentialFile(SequentialFileFactory factory,
int bufferSize,
long bufferTimeoutMilliseconds,
String directory,
String fileName,
int maxIO,
BufferCallback bufferCallback,
Executor writerExecutor,
Executor pollerExecutor) |
| Modifier and Type | Method and Description |
|---|---|
int |
calculateBlockStart(int position) |
SequentialFile |
cloneFile() |
void |
close() |
void |
fill(int position,
int size,
byte fillCharacter) |
int |
getAlignment() |
boolean |
isOpen() |
protected ByteBuffer |
newBuffer(int size,
int limit) |
void |
onIOException(int code,
String message) |
void |
open() |
void |
open(int maxIO,
boolean useExecutor)
The maximum number of simultaneous writes accepted
|
int |
read(ByteBuffer bytes) |
int |
read(ByteBuffer bytes,
IOAsyncTask callback) |
void |
setBufferCallback(BufferCallback callback) |
long |
size() |
void |
sync() |
String |
toString() |
void |
waitForClose() |
void |
writeDirect(ByteBuffer bytes,
boolean sync)
Write directly to the file without using any buffer
|
void |
writeDirect(ByteBuffer bytes,
boolean sync,
IOAsyncTask callback)
Write directly to the file without using any buffer
|
void |
writeInternal(ByteBuffer bytes)
Write directly to the file.
|
copyTo, delete, exists, fits, getFile, getFileName, position, position, renameTo, setTimedBuffer, write, write, write, writepublic AIOSequentialFile(SequentialFileFactory factory, int bufferSize, long bufferTimeoutMilliseconds, String directory, String fileName, int maxIO, BufferCallback bufferCallback, Executor writerExecutor, Executor pollerExecutor)
public boolean isOpen()
isOpen in interface SequentialFilepublic int getAlignment()
throws Exception
getAlignment in interface SequentialFileExceptionpublic int calculateBlockStart(int position)
throws Exception
calculateBlockStart in interface SequentialFileExceptionpublic SequentialFile cloneFile()
cloneFile in interface SequentialFilepublic void close()
throws Exception
close in interface SequentialFileclose in class AbstractSequentialFileExceptionpublic void waitForClose()
throws Exception
waitForClose in interface SequentialFileExceptionpublic void fill(int position,
int size,
byte fillCharacter)
throws Exception
fill in interface SequentialFileExceptionpublic void open()
throws Exception
open in interface SequentialFileExceptionpublic void open(int maxIO,
boolean useExecutor)
throws Exception
SequentialFileopen in interface SequentialFileExceptionpublic void setBufferCallback(BufferCallback callback)
public int read(ByteBuffer bytes, IOAsyncTask callback) throws Exception
read in interface SequentialFileExceptionpublic int read(ByteBuffer bytes) throws Exception
read in interface SequentialFileExceptionpublic void sync()
throws Exception
sync in interface SequentialFileExceptionpublic long size()
throws Exception
size in interface SequentialFileExceptionpublic void onIOException(int code,
String message)
onIOException in interface IOExceptionListenerpublic void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
SequentialFilewriteDirect in interface SequentialFileExceptionpublic void writeDirect(ByteBuffer bytes, boolean sync, IOAsyncTask callback)
SequentialFilewriteDirect in interface SequentialFilesync - Not used on AIOpublic void writeInternal(ByteBuffer bytes) throws Exception
SequentialFilewriteInternal in interface SequentialFileExceptionprotected ByteBuffer newBuffer(int size, int limit)
newBuffer in class AbstractSequentialFileCopyright © 2012 JBoss by Red Hat. All Rights Reserved.