Packages

final class FileChannel extends BlockingChannel

A channel for reading, writing, mapping, and manipulating a file.

Unlike network channels, file channels are seekable with a current position that can be changed. The inherited read and write methods that do not take a position operate at the current position and update the position based on the number of bytes actually read or written.

Self Type
FileChannel
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileChannel
  2. BlockingChannel
  3. Channel
  4. IOCloseable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class BlockingFileOps extends GatheringByteOps with ScatteringByteOps
  2. type BlockingOps = BlockingFileOps

    The blocking operations supported by this channel.

    The blocking operations supported by this channel.

    Definition Classes
    FileChannelBlockingChannel

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 channel: java.nio.channels.FileChannel
    Attributes
    protected
    Definition Classes
    FileChannelChannel
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def close(implicit trace: Trace): IO[IOException, Unit]

    Closes this channel.

    Closes this channel.

    Definition Classes
    ChannelIOCloseable
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. def flatMapBlocking[R, E, A](f: (BlockingFileOps) => ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

    Puts this channel in blocking mode (if applicable) and performs a set of blocking operations.

    Puts this channel in blocking mode (if applicable) and performs a set of blocking operations. Uses the standard ZIO Blocking service to run the provided effect on the blocking thread pool. Installs interrupt handling so that if the ZIO fiber is interrupted, this channel will be closed, which will unblock any currently blocked operations.

    f

    Given a BlockingOps argument appropriate for this channel type, produces an effect value containing blocking operations.

    Definition Classes
    FileChannelBlockingChannel
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def isOpen(implicit trace: Trace): UIO[Boolean]

    Tells whether or not this channel is open.

    Tells whether or not this channel is open.

    Definition Classes
    Channel
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def nioBlocking[R, E, A](zioEffect: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
    Attributes
    protected
    Definition Classes
    BlockingChannel
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def position(newPosition: Long)(implicit trace: Trace): IO[IOException, Unit]

    Sets this channel's position.

    Sets this channel's position. Setting the position to a value that is greater than the file's current size is legal but does not change the size of the file. A later attempt to read bytes at such a position will immediately return an end-of-file indication. A later attempt to write bytes at such a position will cause the file to be grown to accommodate the new bytes; the values of any bytes between the previous end-of-file and the newly-written bytes are unspecified.

    newPosition

    The new position, must be >= 0

  21. def position(implicit trace: Trace): IO[IOException, Long]

    Returns the current value of this channel's position.

  22. def size(implicit trace: Trace): IO[IOException, Long]

    Returns the current size of this channel's file.

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. def tryLock(position: Long = 0L, size: Long = Long.MaxValue, shared: Boolean = false)(implicit trace: Trace): IO[IOException, Option[FileLock]]

    Attempts to acquire a lock on the given region of this channel's file.

    Attempts to acquire a lock on the given region of this channel's file. This method does not block. An invocation always returns immediately, either having acquired a lock on the requested region or having failed to do so. If it fails to acquire a lock because an overlapping lock is held by another program then it returns None. If it fails to acquire a lock for any other reason then an appropriate exception is thrown.

    position

    The position at which the locked region is to start, must be >= 0

    size

    The size of the locked region; must be >= 0, and the sum position + size must be >= 0

    shared

    true to request a shared lock, in which case this channel must be open for reading (and possibly writing); false to request an exclusive lock, in which case this channel must be open for writing (and possibly reading)

  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from BlockingChannel

Inherited from Channel

Inherited from IOCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped