public abstract class FileIO extends ConcurrentCloseable implements IO.KnownSize
| Modifier and Type | Class and Description |
|---|---|
static class |
FileIO.ReadOnly
FileIO in read-only mode.
|
static class |
FileIO.ReadWrite
FileIO with read and write operations.
|
static class |
FileIO.WriteOnly
FileIO in write-only mode.
|
IO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Seekable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impl| Modifier and Type | Field and Description |
|---|---|
protected FileAccess |
file |
| Modifier | Constructor and Description |
|---|---|
protected |
FileIO(File file,
String mode,
byte priority) |
| Modifier and Type | Method and Description |
|---|---|
ISynchronizationPoint<IOException> |
canStart()
Can start reading or writing.
|
protected void |
closeResources(SynchronizationPoint<Exception> ondone) |
protected ISynchronizationPoint<?> |
closeUnderlyingResources() |
File |
getFile() |
protected long |
getPosition() |
byte |
getPriority()
Return the priority.
|
AsyncWork<Long,IOException> |
getSizeAsync()
Asynchronous operation to get the size of the IO.
|
long |
getSizeSync()
Synchronous operation to get the size of the IO.
|
String |
getSourceDescription()
Describe the IO, which can be used for logging or debugging purposes.
|
TaskManager |
getTaskManager()
Return the TaskManager used for asynchronous operations.
|
IO |
getWrappedIO()
If this IO is wrapping another one (such as adding Buffered capabilities), this method returns it,
or null if it does not wrap another IO.
|
protected AsyncWork<Integer,IOException> |
readAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected AsyncWork<Integer,IOException> |
readAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected AsyncWork<Integer,IOException> |
readFullyAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected AsyncWork<Integer,IOException> |
readFullyAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected int |
readFullySync(ByteBuffer buffer) |
protected int |
readFullySync(long pos,
ByteBuffer buffer) |
protected int |
readSync(ByteBuffer buffer) |
protected int |
readSync(long pos,
ByteBuffer buffer) |
protected AsyncWork<Long,IOException> |
seekAsync(IO.Seekable.SeekType type,
long move,
RunnableWithParameter<Pair<Long,IOException>> ondone) |
protected long |
seekSync(IO.Seekable.SeekType type,
long move) |
void |
setPriority(byte priority)
Set the priority of asynchronous operations.
|
protected AsyncWork<Void,IOException> |
setSizeAsync(long size) |
protected void |
setSizeSync(long size) |
protected AsyncWork<Long,IOException> |
skipAsync(long n,
RunnableWithParameter<Pair<Long,IOException>> ondone) |
protected long |
skipSync(long n) |
protected AsyncWork<Integer,IOException> |
writeAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected AsyncWork<Integer,IOException> |
writeAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected int |
writeSync(ByteBuffer buffer) |
protected int |
writeSync(long pos,
ByteBuffer buffer) |
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerprotected FileAccess file
public ISynchronizationPoint<IOException> canStart()
public File getFile()
public String getSourceDescription()
IOgetSourceDescription in interface IOpublic IO getWrappedIO()
IOgetWrappedIO in interface IOpublic byte getPriority()
ConcurrentCloseablegetPriority in interface IOgetPriority in class ConcurrentCloseablepublic void setPriority(byte priority)
IOsetPriority in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOprotected long getPosition()
throws IOException
IOExceptionprotected long seekSync(IO.Seekable.SeekType type, long move) throws IOException
IOExceptionprotected AsyncWork<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, RunnableWithParameter<Pair<Long,IOException>> ondone)
protected long skipSync(long n)
throws IOException
IOExceptionprotected AsyncWork<Long,IOException> skipAsync(long n, RunnableWithParameter<Pair<Long,IOException>> ondone)
public long getSizeSync()
throws IOException
IO.KnownSizegetSizeSync in interface IO.KnownSizeIOExceptionpublic AsyncWork<Long,IOException> getSizeAsync()
IO.KnownSizegetSizeAsync in interface IO.KnownSizeprotected void setSizeSync(long size)
throws IOException
IOExceptionprotected AsyncWork<Void,IOException> setSizeAsync(long size)
protected ISynchronizationPoint<?> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseableprotected void closeResources(SynchronizationPoint<Exception> ondone)
closeResources in class ConcurrentCloseableprotected int readSync(ByteBuffer buffer) throws IOException
IOExceptionprotected int readSync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionprotected AsyncWork<Integer,IOException> readAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected AsyncWork<Integer,IOException> readAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected int readFullySync(ByteBuffer buffer) throws IOException
IOExceptionprotected int readFullySync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionprotected AsyncWork<Integer,IOException> readFullyAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected AsyncWork<Integer,IOException> readFullyAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected int writeSync(ByteBuffer buffer) throws IOException
IOExceptionprotected int writeSync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionprotected AsyncWork<Integer,IOException> writeAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected AsyncWork<Integer,IOException> writeAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
Copyright © 2018. All rights reserved.