Class/Object

zio.nio.channels

FileChannel

Related Docs: object FileChannel | package channels

Permalink

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
Linear Supertypes
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. All

Type Members

  1. final class BlockingFileOps extends GatheringByteOps with ScatteringByteOps

    Permalink
  2. type BlockingOps = BlockingFileOps

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val channel: java.nio.channels.FileChannel

    Permalink
    Attributes
    protected
    Definition Classes
    FileChannelChannel
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def close(implicit trace: ZTraceElement): IO[IOException, Unit]

    Permalink

    Closes this channel.

    Closes this channel.

    Definition Classes
    ChannelIOCloseable
  8. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flatMapBlocking[R, E, A](f: (BlockingFileOps) ⇒ ZIO[R, E, A])(implicit trace: ZTraceElement): ZIO[R, E, A]

    Permalink

    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[_]

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

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

    Permalink
    Definition Classes
    Any
  15. final def isOpen(implicit trace: ZTraceElement): UIO[Boolean]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  17. final def nioBlocking[R, E, A](zioEffect: ZIO[R, E, A])(implicit trace: ZTraceElement): ZIO[R, E, A]

    Permalink
    Attributes
    protected
    Definition Classes
    BlockingChannel
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def position(newPosition: Long)(implicit trace: ZTraceElement): IO[IOException, Unit]

    Permalink

    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: ZTraceElement): IO[IOException, Long]

    Permalink

    Returns the current value of this channel's position.

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

    Permalink

    Returns the current size of this channel's file.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. def tryLock(position: Long = 0L, size: Long = Long.MaxValue, shared: Boolean = false)(implicit trace: ZTraceElement): IO[IOException, Option[FileLock]]

    Permalink

    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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from BlockingChannel

Inherited from Channel

Inherited from IOCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped