Packages

class AsyncFile extends ReadStream[Buffer] with WriteStream[Buffer]

Represents a file on the file-system which can be read from, or written to asynchronously.

This class also implements io.vertx.scala.core.streams.ReadStream and io.vertx.scala.core.streams.WriteStream. This allows the data to be pumped to and from other streams, e.g. an io.vertx.scala.core.http.HttpClientRequest instance, using the io.vertx.scala.core.streams.Pump class

Linear Supertypes
WriteStream[Buffer], ReadStream[Buffer], StreamBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncFile
  2. WriteStream
  3. ReadStream
  4. StreamBase
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncFile(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
    Definition Classes
    AsyncFileWriteStreamReadStreamStreamBase
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def close(handler: Handler[AsyncResult[Unit]]): Unit

    Close the file.

    Close the file. The actual close happens asynchronously. The handler will be called when the close is complete, or an error occurs. * @param handler the handler

  8. def close(): Unit

    Close the file.

    Close the file. The actual close happens asynchronously.

  9. def closeFuture(): scala.concurrent.Future[Unit]

    Like close but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  10. def drainHandler(handler: Handler[Unit]): AsyncFile

    Set a drain handler on the stream.

    Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See io.vertx.scala.core.streams.Pump for an example of this being used.

    The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to maxSize / 2. * @param handler the handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileWriteStream
  11. def end(handler: Handler[AsyncResult[Unit]]): Unit

    Close the file, see io.vertx.scala.core.file.AsyncFile#close.

    Definition Classes
    AsyncFileWriteStream
  12. def end(): Unit

    Close the file, see io.vertx.scala.core.file.AsyncFile#close.

    Definition Classes
    AsyncFileWriteStream
  13. def end(data: Buffer, handler: Handler[AsyncResult[Unit]]): Unit

    Same as but with an handler called when the operation completes

    Same as but with an handler called when the operation completes

    Definition Classes
    AsyncFileWriteStream
  14. def end(data: Buffer): Unit

    Same as io.vertx.scala.core.file.AsyncFile#end but writes some data to the stream before ending.

    Same as io.vertx.scala.core.file.AsyncFile#end but writes some data to the stream before ending. * @param data the data to write

    Definition Classes
    AsyncFileWriteStream
  15. def endFuture(): scala.concurrent.Future[Unit]

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    AsyncFileWriteStream
  16. def endFuture(data: Buffer): scala.concurrent.Future[Unit]

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like end but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    AsyncFileWriteStream
  17. def endHandler(endHandler: Handler[Unit]): AsyncFile

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. * @return a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileReadStream
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def exceptionHandler(handler: Handler[Throwable]): AsyncFile

    Set an exception handler on the write stream.

    Set an exception handler on the write stream. * @param handler the exception handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileWriteStreamReadStreamStreamBase
  21. def fetch(amount: Long): AsyncFile

    Fetch the specified amount of elements.

    Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand. * @return a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileReadStream
  22. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def flush(handler: Handler[AsyncResult[Unit]]): AsyncFile

    Same as io.vertx.scala.core.file.AsyncFile#flush but the handler will be called when the flush is complete or if an error occurs

  24. def flush(): AsyncFile

    Flush any writes made to this file to underlying persistent storage.

    Flush any writes made to this file to underlying persistent storage.

    If the file was opened with flush set to true then calling this method will have no effect.

    The actual flush will happen asynchronously. * @return a reference to this, so the API can be used fluently

  25. def flushFuture(): scala.concurrent.Future[Unit]

    Like flush but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def getWritePos(): Long

    returns

    the current write position the file is at

  28. def handler(handler: Handler[Buffer]): AsyncFile

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileReadStream
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. def pause(): AsyncFile

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    While it's paused, no data will be sent to the data handler. * @return a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileReadStream
  35. def pipe(): Pipe[Buffer]

    Pause this stream and return a to transfer the elements of this stream to a destination .

    Pause this stream and return a to transfer the elements of this stream to a destination .

    The stream will be resumed when the pipe will be wired to a WriteStream. * @return a pipe

    Definition Classes
    AsyncFileReadStream
  36. def pipeTo(dst: WriteStream[Buffer], handler: Handler[AsyncResult[Unit]]): Unit

    Pipe this ReadStream to the WriteStream.

    Pipe this ReadStream to the WriteStream.

    Elements emitted by this stream will be written to the write stream until this stream ends or fails.

    Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result. * @param dst the destination write stream

    Definition Classes
    AsyncFileReadStream
  37. def pipeTo(dst: WriteStream[Buffer]): Unit

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Definition Classes
    AsyncFileReadStream
  38. def pipeToFuture(dst: WriteStream[Buffer]): scala.concurrent.Future[Unit]

    Like pipeTo but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like pipeTo but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    AsyncFileReadStream
  39. def read(buffer: Buffer, offset: Int, position: Long, length: Int, handler: Handler[AsyncResult[Buffer]]): AsyncFile

    Reads length bytes of data from the file at position position in the file, asynchronously.

    Reads length bytes of data from the file at position position in the file, asynchronously.

    The read data will be written into the specified Buffer buffer at position offset.

    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. * @param buffer the buffer to read into

    offset

    the offset into the buffer where the data will be read

    position

    the position in the file where to start reading

    length

    the number of bytes to read

    handler

    the handler to call when the write is complete

    returns

    a reference to this, so the API can be used fluently

  40. def readFuture(buffer: Buffer, offset: Int, position: Long, length: Int): scala.concurrent.Future[Buffer]

    Like read but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  41. def resume(): AsyncFile

    Resume reading, and sets the buffer in flowing mode.

    Resume reading, and sets the buffer in flowing mode.

    If the ReadStream has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileReadStream
  42. def setReadBufferSize(readBufferSize: Int): AsyncFile

    Sets the buffer size that will be used to read the data from the file.

    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. * @param readBufferSize the buffer size

    returns

    a reference to this, so the API can be used fluently

  43. def setReadPos(readPos: Long): AsyncFile

    Sets the position from which data will be read from when using the file as a io.vertx.scala.core.streams.ReadStream.

    Sets the position from which data will be read from when using the file as a io.vertx.scala.core.streams.ReadStream. * @param readPos the position in the file

    returns

    a reference to this, so the API can be used fluently

  44. def setWritePos(writePos: Long): AsyncFile

    Sets the position from which data will be written when using the file as a io.vertx.scala.core.streams.WriteStream.

    Sets the position from which data will be written when using the file as a io.vertx.scala.core.streams.WriteStream. * @param writePos the position in the file

    returns

    a reference to this, so the API can be used fluently

  45. def setWriteQueueMaxSize(maxSize: Int): AsyncFile

    Set the maximum size of the write queue to maxSize.

    Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize items in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

    The value is defined by the implementation of the stream, e.g in bytes for a io.vertx.scala.core.net.NetSocket, the number of io.vertx.scala.core.eventbus.Message for a io.vertx.scala.core.eventbus.MessageProducer, etc... * @param maxSize the max size of the write stream

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileWriteStream
  46. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  47. def toString(): String
    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  51. def write(buffer: Buffer, position: Long, handler: Handler[AsyncResult[Unit]]): AsyncFile

    Write a io.vertx.scala.core.buffer.Buffer to the file at position position in the file, asynchronously.

    Write a io.vertx.scala.core.buffer.Buffer to the file at position position in the file, asynchronously.

    If position lies outside of the current size of the file, the file will be enlarged to encompass it.

    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. * @param buffer the buffer to write

    position

    the position in the file to write it at

    handler

    the handler to call when the write is complete

    returns

    a reference to this, so the API can be used fluently

  52. def write(data: Buffer, handler: Handler[AsyncResult[Unit]]): AsyncFile

    Same as io.vertx.scala.core.file.AsyncFile#write but with an handler called when the operation completes

    Same as io.vertx.scala.core.file.AsyncFile#write but with an handler called when the operation completes

    Definition Classes
    AsyncFileWriteStream
  53. def write(data: Buffer): AsyncFile

    Write some data to the stream.

    Write some data to the stream. The data is put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the io.vertx.scala.core.streams.WriteStream#writeQueueFull method before writing. This is done automatically if using a io.vertx.scala.core.streams.Pump. * @param data the data to write

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    AsyncFileWriteStream
  54. def writeFuture(buffer: Buffer, position: Long): scala.concurrent.Future[Unit]

    Like write but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  55. def writeFuture(data: Buffer): scala.concurrent.Future[Unit]

    Like write but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Like write but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

    Definition Classes
    AsyncFileWriteStream
  56. def writeQueueFull(): Boolean

    This will return true if there are more bytes in the write queue than the value set using io.vertx.scala.core.file.AsyncFile#setWriteQueueMaxSize * @return true if write queue is full

    This will return true if there are more bytes in the write queue than the value set using io.vertx.scala.core.file.AsyncFile#setWriteQueueMaxSize * @return true if write queue is full

    Definition Classes
    AsyncFileWriteStream

Inherited from WriteStream[Buffer]

Inherited from ReadStream[Buffer]

Inherited from StreamBase

Inherited from AnyRef

Inherited from Any

Ungrouped