public class FileAccess extends Object implements AutoCloseable
| Constructor and Description |
|---|
FileAccess(File file,
String mode,
byte priority)
Constructor.
|
public String getPath()
public File getFile()
public Task<Void,IOException> getStartingTask()
public RandomAccessFile getDirectAccess()
public byte getPriority()
public void setPriority(byte priority)
public void open()
throws IOException
IOExceptionpublic Task<Void,IOException> closeAsync()
public void close()
close in interface AutoCloseablepublic long getPosition()
throws IOException
IOExceptionpublic long getSize()
throws IOException
IOExceptionpublic void getSize(AsyncSupplier<Long,IOException> sp)
public void setSize(long newSize)
throws IOException
IOExceptionpublic Task<Void,IOException> setSizeAsync(long newSize)
public int read(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionpublic Task<Integer,IOException> readAsync(long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
public int readFully(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionpublic Task<Integer,IOException> readFullyAsync(long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
public long seek(IO.Seekable.SeekType type, long move, boolean allowAfterEnd) throws IOException
IOExceptionpublic Task<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, boolean allowAfterEnd, Consumer<Pair<Long,IOException>> ondone)
public long skip(long move)
throws IOException
IOExceptionpublic Task<Long,IOException> skipAsync(long move, Consumer<Pair<Long,IOException>> ondone)
public int write(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionpublic Task<Integer,IOException> writeAsync(long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
Copyright © 2019. All rights reserved.