Encoder that writes the BOM for this charset
A typeclass to denote a disposable resource
Given a disposable resource, this actually does the disposing
Scala wrapper around java.nio.files.Path
Scala wrapper around java.nio.files.Path
Implementation of File.Monitor
Container for various implicits
Code ported from Java to Scala: https://github.com/apache/commons-io/blob/c0eb48f7e83987c5ed112b82f0d651aff5149ae4/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
Finds and loads class resources or class loader resources.
Finds and loads class resources or class loader resources.
The default implementation of this trait is the Resource object, which looks up resources
using the current thread's context class loader.
The Resource object also offers several other Resource implementations,
through its methods at
, from
, and my
. at
searches from a Class,
from
searches from a ClassLoader,
and my
searches from the class, trait, or object surrounding the call.
// Look up the config.properties file for this class or object. Resource.my.asStream("config.properties") // Find logging.properties (in the root package) somewhere on the classpath. Resource.url("logging.properties")
Implement this trait to make thing parsable In most cases, use Scanner.Read typeclass when you simply need access to one String token Use Scannable typeclass if you need access to the full scanner e.g.
Implement this trait to make thing parsable In most cases, use Scanner.Read typeclass when you simply need access to one String token Use Scannable typeclass if you need access to the full scanner e.g. to detect encodings etc.
Write to multiple outputstreams at once If error happens on any one while doing an operation, only the last error is reported
A Unicode charset that handles byte-order markers
A Unicode decoder that uses the Unicode byte-order marker (BOM) to auto-detect the encoding (if none detected, falls back on the defaultCharset).
A Unicode decoder that uses the Unicode byte-order marker (BOM) to auto-detect the encoding (if none detected, falls back on the defaultCharset). This also gets around a bug in the JDK (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4508058) where BOM is not consumed for UTF-8. See: https://github.com/pathikrit/better-files/issues/107
Code ported from Java to Scala: https://github.com/apache/commons-io/blob/d357d9d563c4a34fa2ab3cdc68221c851a9de4f5/src/main/java/org/apache/commons/io/output/WriterOutputStream.java
Default array buffer size Seems like a good value used by JDK: (see: java.io.BufferedInputStream.DEFAULT_BUFFER_SIZE)
The Default charset used by better-files Note: It uses java.net.charset.Charset.DefaultCharset() in general but if the Default supports byte-order markers, it uses a more compliant version than the JDK one (see: https://github.com/pathikrit/better-files/issues/107)
Do file ops using a UNIX command line DSL
A sink outputstream similar to /dev/null - just consumes everything
Implementations of Resource.
Implementations of Resource.
This object itself is a Resource uses the current thread's
context class loader.
It also creates Resources with different lookup behavior, using the methods at
, from
, and my
. at
searches
rom a Class, from
searches
from a different ClassLoader,
and my
searches from the class, trait, or object surrounding the call.
Faster, safer and more idiomatic Scala replacement for java.util.Scanner See: http://codeforces.com/blog/entry/7018
Compose this managed resource with another managed resource closing the outer one after the inner one
Compose this managed resource with another managed resource closing the outer one after the inner one
Use this to create custom readers e.g.
Use this to create custom readers e.g. to read a LocalDate using some custom format val readLocalDate: Read[LocalDate] = Read.temporalQuery(format = myFormat, query = LocalDate.from)
Use the current managed resource as a generator needed to create another sequence
Use the current managed resource as a generator needed to create another sequence
Similar to the with
keyword in Python and using
keyword in .NET and try-with-resource
syntax in Java,
this let's you use and dispose a resource e.g.
Similar to the with
keyword in Python and using
keyword in .NET and try-with-resource
syntax in Java,
this let's you use and dispose a resource e.g.
{{ val lines: List[String] = using(file.newInputStream) { stream => stream.lines.toList // Must be eager so .toList } }}