org.vertx.scala.core.file

AsyncFile

final class AsyncFile extends Self with ReadStream with WriteStream with Closeable

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

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

Instances of AsyncFile are not thread-safe

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncFile
  2. Closeable
  3. WriteStream
  4. ReadStream
  5. ReadSupport
  6. ExceptionSupport
  7. AsJava
  8. Self
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type CloseType = AnyRef { ... /* 2 definitions in type refinement */ }

    Definition Classes
    Closeable
  2. type J = java.core.file.AsyncFile

    The internal type of the Java wrapped class.

    The internal type of the Java wrapped class.

    Definition Classes
    AsyncFileCloseableWriteStreamReadStreamReadSupportExceptionSupport → AsJava

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. val asJava: java.core.file.AsyncFile

    The internal instance of the Java wrapped class.

    The internal instance of the Java wrapped class.

    Definition Classes
    AsyncFile → AsJava
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def close(handler: (AsyncResult[Void]) ⇒ Unit): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Definition Classes
    Closeable
  8. def close(): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Definition Classes
    Closeable
  9. def dataHandler(handler: (Buffer) ⇒ Unit): AsyncFile.this.type

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data.

    Definition Classes
    ReadStreamReadSupport
  10. def drainHandler(handler: ⇒ Unit): AsyncFile.this.type

    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 has been reduced to maxSize / 2. See org.vertx.scala.core.streams.Pump for an example of this being used.

    Definition Classes
    WriteStream
  11. def endHandler(handler: ⇒ Unit): AsyncFile.this.type

    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.

    Definition Classes
    ReadStream
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def exceptionHandler(handler: (Throwable) ⇒ Unit): AsyncFile.this.type

    Set an exception handler.

    Set an exception handler.

    Definition Classes
    ExceptionSupport
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def flush(handler: (AsyncResult[Void]) ⇒ Unit): AsyncFile

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

  17. 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.

  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def pause(): AsyncFile.this.type

    Pause the ReadSupport.

    Pause the ReadSupport. While it's paused, no data will be sent to the dataHandler

    Definition Classes
    ReadSupport
  25. def read(buffer: Buffer, offset: Int, position: Int, length: Int, handler: (AsyncResult[Buffer]) ⇒ Unit): AsyncFile

    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.

    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.

  26. def resume(): AsyncFile.this.type

    Resume reading.

    Resume reading. If the ReadSupport has been paused, reading will recommence on it.

    Definition Classes
    ReadSupport
  27. def setWriteQueueMaxSize(maxSize: Int): AsyncFile.this.type

    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 bytes in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

    Definition Classes
    WriteStream
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. def wrap[X](doStuff: ⇒ X): AsyncFile.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self
  34. def write(buffer: Buffer, position: Int, handler: (AsyncResult[Void]) ⇒ Unit): AsyncFile

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

    Write a org.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.

  35. def write(data: Buffer): AsyncFile.this.type

    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 org.vertx.scala.core.streams.WriteStream.writeQueueFull() method before writing. This is done automatically if using a org.vertx.scala.core.streams.Pump.

    Definition Classes
    WriteStream
  36. def writeQueueFull(): Boolean

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.WriteStream.setWriteQueueMaxSize()

    Definition Classes
    WriteStream

Inherited from Closeable

Inherited from WriteStream

Inherited from ReadStream

Inherited from ReadSupport[Buffer]

Inherited from ExceptionSupport

Inherited from AsJava

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped