read

os.read
object read extends ReadablePath => String

Reads the contents of a os.Path or other os.Source as a java.lang.String. Defaults to reading the entire file as UTF-8, but you can also select a different charSet to use, and provide an offset/count to read from if the source supports seeking.

Attributes

Graph
Supertypes
trait ReadablePath => String
class Object
trait Matchable
class Any
Self type
read.type

Members list

Type members

Classlikes

object bytes extends ReadablePath => Array[Byte]

Reads the contents of a os.Path or os.Source as an Array[Byte]; you can provide an offset/count to read from if the source supports seeking.

Reads the contents of a os.Path or os.Source as an Array[Byte]; you can provide an offset/count to read from if the source supports seeking.

Attributes

Supertypes
trait ReadablePath => Array[Byte]
class Object
trait Matchable
class Any
Self type
bytes.type
object channel extends Path => SeekableByteChannel

Opens a SeekableByteChannel to read from the given file.

Opens a SeekableByteChannel to read from the given file.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
channel.type
object chunks

Reads the contents of the given os.Path in chunks of the given size; returns a generator which provides a byte array and an offset into that array which contains the data for that chunk. All chunks will be of the given size, except for the last chunk which may be smaller.

Reads the contents of the given os.Path in chunks of the given size; returns a generator which provides a byte array and an offset into that array which contains the data for that chunk. All chunks will be of the given size, except for the last chunk which may be smaller.

Note that the array returned by the generator is shared between each callback; make sure you copy the bytes/array somewhere else if you want to keep them around.

Optionally takes in a provided input buffer instead of a chunkSize, allowing you to re-use the buffer between invocations.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
chunks.type

Opens a java.io.InputStream to read from the given file

Opens a java.io.InputStream to read from the given file

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object lines extends ReadablePath => IndexedSeq[String]

Reads the given os.Path or other os.Source as a string and splits it into lines; defaults to reading as UTF-8, which you can override by specifying a charSet.

Reads the given os.Path or other os.Source as a string and splits it into lines; defaults to reading as UTF-8, which you can override by specifying a charSet.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
lines.type
object stream extends ReadablePath => Readable

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
stream.type

Value members

Concrete methods

def apply(arg: ReadablePath, charSet: Codec): String
def apply(arg: Path, charSet: Codec, offset: Long, count: Int): String

Inherited methods

def andThen[A](g: String => A): T1 => A

Attributes

Inherited from:
Function1
def compose[A](g: A => ReadablePath): A => R

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1