Class/Object

org.platanios.tensorflow.api.io

FileIO

Related Docs: object FileIO | package io

Permalink

case class FileIO(filePath: Path, mode: Mode, readBufferSize: Long = 1024 * 512) extends utilities.Closeable with Product with Serializable

Helper class used for reading from and writing to a file.

IMPORTANT: FileIO.close() needs to be called after being done with this object in order to prevent memory leaks. The memory will not be automatically freed, like its done for tensors and graphs.

filePath

Path to a file.

mode

Mode in which to open the file.

readBufferSize

Buffer size used when reading from the file.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileIO
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Closeable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FileIO(filePath: Path, mode: Mode, readBufferSize: Long = 1024 * 512)

    Permalink

    filePath

    Path to a file.

    mode

    Mode in which to open the file.

    readBufferSize

    Buffer size used when reading from the file.

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. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def close(): Unit

    Permalink

    Releases the native resources associated with this object.

    Releases the native resources associated with this object.

    Definition Classes
    Closeable
  7. val closeFn: () ⇒ Unit

    Permalink

    Closes this file IO object and releases any resources associated with it.

    Closes this file IO object and releases any resources associated with it. Note that an events file reader is not usable after it has been closed.

    Attributes
    protected
    Definition Classes
    FileIOCloseable
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. val filePath: Path

    Permalink

    Path to a file.

  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flush(): FileIO

    Permalink

    Flushes the file.

    Flushes the file. This only ensures that the data has made its way out of the process without any guarantees on whether it is written to disk. This means that the data would survive an application crash but not necessarily an OS crash.

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

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

    Permalink
    Definition Classes
    Any
  14. def linesIterator: Iterator[String]

    Permalink

    Returns an iterator over the lines in this file (including the new-line character at the end of each line).

  15. val mode: Mode

    Permalink

    Mode in which to open the file.

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  19. def read(numBytes: Long = 1L): String

    Permalink

    Returns the contents of the file as a string, starting from current position in the file.

    Returns the contents of the file as a string, starting from current position in the file.

    numBytes

    Number of bytes to read from the file. If equal to -1 (the default) then the file is read up to its end.

    returns

    Read contents of the file as a string.

  20. val readBufferSize: Long

    Permalink

    Buffer size used when reading from the file.

  21. def readLine(): String

    Permalink

    Reads the next line from the file and returns it (including the new-line character at the end).

  22. def readLines(): Seq[String]

    Permalink

    Reads all the lines from the file and returns them (including the new-line character at the end of each line).

  23. def seek(offset: Long, whence: Whence = FileIO.START_OF_FILE): FileIO

    Permalink

    Seeks to the provided offset in the file.

    Seeks to the provided offset in the file.

    offset

    Position offset.

    whence

    Position reference, relative to which offset is defined.

  24. def size: Long

    Permalink

    Returns the size of the file.

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

    Permalink
    Definition Classes
    AnyRef
  26. def tell: Long

    Permalink

    Returns the current position in the file.

  27. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def write(content: String): FileIO

    Permalink

    Appends content to the end of the file.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from utilities.Closeable

Inherited from AnyRef

Inherited from Any

Ungrouped