public class NIOSequentialFile extends AbstractSequentialFile
AbstractSequentialFile.DelegateCallback, AbstractSequentialFile.LocalBufferObserver
factory, fileSize, position, timedBuffer, timedBufferObserver, writerExecutor
Constructor and Description |
---|
NIOSequentialFile(SequentialFileFactory factory,
File file,
int maxIO,
Executor writerExecutor) |
NIOSequentialFile(SequentialFileFactory factory,
String directory,
String fileName,
int maxIO,
Executor writerExecutor) |
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 |
open()
this.maxIO represents the default maxIO.
|
void |
open(int maxIO,
boolean useExecutor)
The maximum number of simultaneous writes accepted
|
void |
position(long pos) |
int |
read(ByteBuffer bytes) |
int |
read(ByteBuffer bytes,
IOAsyncTask 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, renameTo, setTimedBuffer, write, write, write, write
public NIOSequentialFile(SequentialFileFactory factory, String directory, String fileName, int maxIO, Executor writerExecutor)
public NIOSequentialFile(SequentialFileFactory factory, File file, int maxIO, Executor writerExecutor)
public int getAlignment()
public boolean isOpen()
public void open() throws Exception
Exception
public void open(int maxIO, boolean useExecutor) throws Exception
SequentialFile
Exception
public void fill(int position, int size, byte fillCharacter) throws Exception
Exception
public void close() throws Exception
close
in interface SequentialFile
close
in class AbstractSequentialFile
Exception
public int read(ByteBuffer bytes) throws Exception
Exception
public int read(ByteBuffer bytes, IOAsyncTask callback) throws Exception
Exception
public void position(long pos) throws Exception
position
in interface SequentialFile
position
in class AbstractSequentialFile
Exception
public SequentialFile cloneFile()
public void writeDirect(ByteBuffer bytes, boolean sync, IOAsyncTask callback)
SequentialFile
public void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
SequentialFile
Exception
public void writeInternal(ByteBuffer bytes) throws Exception
SequentialFile
Exception
protected ByteBuffer newBuffer(int size, int limit)
newBuffer
in class AbstractSequentialFile
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.