public class AsyncFile extends Object
| Constructor and Description |
|---|
AsyncFile()
create an unitialized AsyncFile.
|
AsyncFile(Path file,
OpenOption... options) |
AsyncFile(String file)
create an async file and open for read
|
AsyncFile(String file,
OpenOption... options)
create an async file and open with given options (e.g.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
asInputStream() |
OutputStream |
asOutputStream()
return a pseudo-blocking output stream.
|
void |
close() |
long |
length() |
void |
open(Path file,
OpenOption... options) |
IPromise<AsyncFileIOEvent> |
read(long position,
int chunkSize,
ByteBuffer target) |
IPromise<AsyncFileIOEvent> |
readFully() |
IPromise<AsyncFileIOEvent> |
write(long filePosition,
ByteBuffer source) |
public AsyncFile()
public AsyncFile(String file) throws IOException
file - IOExceptionpublic AsyncFile(String file, OpenOption... options) throws IOException
file - IOExceptionpublic AsyncFile(Path file, OpenOption... options) throws IOException
IOExceptionpublic InputStream asInputStream()
public OutputStream asOutputStream()
public void open(Path file, OpenOption... options) throws IOException
IOExceptionpublic long length()
public IPromise<AsyncFileIOEvent> readFully()
public IPromise<AsyncFileIOEvent> read(long position, int chunkSize, ByteBuffer target)
public IPromise<AsyncFileIOEvent> write(long filePosition, ByteBuffer source)
public void close()
Copyright © 2019. All rights reserved.