This class also implements io. and
io.. This allows the data to be piped to and from
other streams, e.g. an io. instance,
using the io. class
| Modifier and Type | Method and Description |
|---|---|
| public Future | |
| public void | |
| public AsyncFile | |
| public AsyncFile | |
| public AsyncFile | |
| public AsyncFile | fetch(long amount)
Redeclares io. Fetch the specified |
| public Future | Returns: a future completed with the resultFlush any writes made to this file to underlying persistent storage. |
| public AsyncFile | flush(Handler<AsyncResult<Void>> handler)
Same as |
| public long | Returns: the number of bytes that will be read when using the file as aio.
|
| public long | |
| public AsyncFile | |
| public Future | Returns: a future indicating the completion of this operationAcquire a non-shared lock on the entire file. |
| public void | lock(Handler<AsyncResult<AsyncFileLock>> handler)
Like |
| public Future | Returns: a future indicating the completion of this operationwhere the region starts position, long the size of the region size, boolean whether the lock should be shared shared)Acquire a lock on a portion of this file. |
| public void | lock(long position, long size, boolean shared, Handler<AsyncResult<AsyncFileLock>> handler)
Like |
| public AsyncFile | pause()
Redeclares io. Pause the |
| public AsyncFile | Returns: a reference to this, so the API can be used fluentlythe buffer to read into buffer, int the offset into the buffer where the data will be read offset, long the position in the file where to start reading position, int the number of bytes to read length, Handler<AsyncResult<Buffer>> the handler to call when the write is complete handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Reads |
| public Future | read(Buffer buffer, int offset, long position, int length)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| public AsyncFile | resume()
Redeclares io. Resume reading, and sets the buffer in |
| public AsyncFile | Returns: a reference to this, so the API can be used fluentlythe buffer size readBufferSize)Sets the buffer size that will be used to read the data from the file. |
| public AsyncFile | Returns: a reference to this, so the API can be used fluentlythe bytes that will be read from the file readLength)Sets the number of bytes that will be read when using the file as a |
| public AsyncFile | Returns: a reference to this, so the API can be used fluentlythe position in the file readPos)Sets the position from which data will be read from when using the file as a |
| public AsyncFile | Returns: a reference to this, so the API can be used fluentlythe position in the file writePos)Sets the position from which data will be written when using the file as a |
| public AsyncFile | setWriteQueueMaxSize(int
the max size of the write stream maxSize)Redeclares io. Set the maximum size of the write queue to |
| public default void | size(Handler<AsyncResult<Long>> handler)
Like |
| public Future | |
| public long | |
| public @Nullable AsyncFileLock | Returns: the lock if it can be acquired immediately, otherwisenullTry to acquire a non-shared lock on the entire file. |
| public @Nullable AsyncFileLock | Returns: the lock if it can be acquired immediately, otherwisenullwhere the region starts position, long the size of the region size, boolean whether the lock should be shared shared)Try to acquire a lock on a portion of this file. |
| public void | write(Buffer
the buffer to write buffer, long the position in the file to write it at position, Handler<AsyncResult<Void>> the handler to call when the write is complete handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Write a |
| public Future | write(Buffer buffer, long position)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| close | back to summary |
|---|---|
| public Future Close the file. The actual close happens asynchronously. | |
| close | back to summary |
|---|---|
| public void close(Handler<AsyncResult<Void>> handler) Close the file. The actual close happens asynchronously. The handler will be called when the close is complete, or an error occurs.
| |
| drainHandler | back to summary |
|---|---|
public AsyncFile drainHandler(Handler<Void> handler)
| |
| endHandler | back to summary |
|---|---|
public AsyncFile endHandler(Handler<Void> endHandler)
| |
| exceptionHandler | back to summary |
|---|---|
public AsyncFile exceptionHandler(Handler<Throwable> handler)
| |
| fetch | back to summary |
|---|---|
| public AsyncFile fetch(long amount) Redeclares io. Doc from io. Fetch the specified | |
| flush | back to summary |
|---|---|
| public Future Flush any writes made to this file to underlying persistent storage.
If the file was opened with The actual flush will happen asynchronously. | |
| flush | back to summary |
|---|---|
| public AsyncFile flush(Handler<AsyncResult<Void>> handler) Same as
| |
| getReadLength | back to summary |
|---|---|
public long getReadLength()
| |
| getWritePos | back to summary |
|---|---|
public long getWritePos()
| |
| handler | back to summary |
|---|---|
public AsyncFile handler(Handler<Buffer> handler)
| |
| lock | back to summary |
|---|---|
| public Future Acquire a non-shared lock on the entire file.
| |
| lock | back to summary |
|---|---|
| public void lock(Handler<AsyncResult<AsyncFileLock>> handler) Like
| |
| lock | back to summary |
|---|---|
| public Future Acquire a lock on a portion of this file.
| |
| lock | back to summary |
|---|---|
| public void lock(long position, long size, boolean shared, Handler<AsyncResult<AsyncFileLock>> handler) Like
| |
| pause | back to summary |
|---|---|
| public AsyncFile pause() Redeclares io. Doc from io. Pause the
While it's paused, no data will be sent to the data | |
| read | back to summary |
|---|---|
| public AsyncFile read(Buffer buffer, int offset, long position, int length, Handler<AsyncResult<Buffer>> handler)
References Deprecated
See corresponding docs for further information. Reads
The read data will be written into the specified If data is read past the end of the file then zero bytes will be read. When multiple reads are invoked on the same file there are no guarantees as to order in which those reads actually occur. The handler will be called when the close is complete, or if an error occurs.
| |
| read | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Like | |
| resume | back to summary |
|---|---|
| public AsyncFile resume() Redeclares io. Doc from io. Resume reading, and sets the buffer in
If the | |
| setReadBufferSize | back to summary |
|---|---|
| public AsyncFile setReadBufferSize(int readBufferSize) Sets the buffer size that will be used to read the data from the file. Changing this value will impact how much the data will be read at a time from the file system. | |
| setReadLength | back to summary |
|---|---|
| public AsyncFile setReadLength(long readLength) Sets the number of bytes that will be read when using the file as a | |
| setReadPos | back to summary |
|---|---|
| public AsyncFile setReadPos(long readPos) Sets the position from which data will be read from when using the file as a | |
| setWritePos | back to summary |
|---|---|
| public AsyncFile setWritePos(long writePos) Sets the position from which data will be written when using the file as a | |
| setWriteQueueMaxSize | back to summary |
|---|---|
| public AsyncFile setWriteQueueMaxSize(int maxSize) Redeclares io. Doc from io. Set the maximum size of the write queue to
The value is defined by the implementation of the stream, e.g in bytes for a
| |
| size | back to summary |
|---|---|
| public default void size(Handler<AsyncResult<Long>> handler) Like | |
| size | back to summary |
|---|---|
| public Future | |
| sizeBlocking | back to summary |
|---|---|
| public long sizeBlocking() Like
| |
| tryLock | back to summary |
|---|---|
| public @Nullable AsyncFileLock tryLock() Try to acquire a non-shared lock on the entire file.
| |
| tryLock | back to summary |
|---|---|
| public @Nullable AsyncFileLock tryLock(long position, long size, boolean shared) Try to acquire a lock on a portion of this file.
| |
| write | back to summary |
|---|---|
| public void write(Buffer buffer, long position, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Write a
If When multiple writes are invoked on the same file there are no guarantees as to order in which those writes actually occur The handler will be called when the write is complete, or if an error occurs.
| |
| write | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Like | |