public class AIOSequentialFile extends AbstractSequentialFile implements IOExceptionListener
AbstractSequentialFile.DelegateCallback, AbstractSequentialFile.LocalBufferObserver
factory, 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, write
public 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 SequentialFile
public int getAlignment() throws Exception
getAlignment
in interface SequentialFile
Exception
public int calculateBlockStart(int position) throws Exception
calculateBlockStart
in interface SequentialFile
Exception
public SequentialFile cloneFile()
cloneFile
in interface SequentialFile
public void close() throws Exception
close
in interface SequentialFile
close
in class AbstractSequentialFile
Exception
public void waitForClose() throws Exception
waitForClose
in interface SequentialFile
Exception
public void fill(int position, int size, byte fillCharacter) throws Exception
fill
in interface SequentialFile
Exception
public void open() throws Exception
open
in interface SequentialFile
Exception
public void open(int maxIO, boolean useExecutor) throws Exception
SequentialFile
open
in interface SequentialFile
Exception
public void setBufferCallback(BufferCallback callback)
public int read(ByteBuffer bytes, IOAsyncTask callback) throws Exception
read
in interface SequentialFile
Exception
public int read(ByteBuffer bytes) throws Exception
read
in interface SequentialFile
Exception
public void sync() throws Exception
sync
in interface SequentialFile
Exception
public long size() throws Exception
size
in interface SequentialFile
Exception
public void onIOException(int code, String message)
onIOException
in interface IOExceptionListener
public void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
SequentialFile
writeDirect
in interface SequentialFile
Exception
public void writeDirect(ByteBuffer bytes, boolean sync, IOAsyncTask callback)
SequentialFile
writeDirect
in interface SequentialFile
sync
- Not used on AIOpublic void writeInternal(ByteBuffer bytes) throws Exception
SequentialFile
writeInternal
in interface SequentialFile
Exception
protected ByteBuffer newBuffer(int size, int limit)
newBuffer
in class AbstractSequentialFile
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.