Add a CloseAction to the end of the CloseAction queue (the last action executed).
Add a CloseAction to the end of the CloseAction queue (the last action executed).
The new action to append
a new instance with the added CloseAction
Creates a CloseAction from the function and passes it to appendCloseAction(CloseAction)
Creates a CloseAction from the function and passes it to appendCloseAction(CloseAction)
The new action to append
a new instance with the added CloseAction
This method aspires to be the fastest way to read a stream of known length into memory.
This method aspires to be the fastest way to read a stream of known length into memory.
Obtains a Traversable for conveniently processing the resource as bytes.
Obtains a Traversable for conveniently processing the resource as bytes.
an non-strict traversable over all the bytes
Obtains a Traversable for conveniently processing the file as Ints.
Obtains a Traversable for conveniently processing the file as Ints.
an non-strict traversable over all the bytes with the bytes being represented as Ints
The characters in the object.
The characters in the object.
If the codec is not the same as the source codec (the codec of the underlying data) then the characters will converted to the desired codec.
The codec representing the desired encoding of the characters @return an traversable of all the characters
Copy all data from this Input object to the Output object as efficiently as possible.
Copy all data from this Input object to the Output object as efficiently as possible.
output sink to copy the data to
do not forward request to output's copyFrom method. Often only one end of the transaction will know how to efficiently transfer data so a common pattern is to check the output and see if the type of the Output object is a known type. If not then the output object will be sent the request. However, to prevent an infinite loop the finalize will be set to true so the request is not then forwarded back to copyTo
Obtain the InputStreamResource(typically) version of this object.
Obtain the InputStreamResource(typically) version of this object.
the InputStreamResource(typically) version of this object.
Obtain an non-strict traversable for iterating through the lines in the object
Obtain an non-strict traversable for iterating through the lines in the object
If the codec is not the same as the source codec (the codec of the underlying data) then the characters will converted to the desired codec.
The strategy for determining the end of line Default is to auto-detect the EOL
if true then the line will end with the line terminator Default is false
@return a non-strict traversable for iterating through all the lines
The codec representing the desired encoding of the characters
Creates a new instance of the underlying resource (or opens it).
Creates a new instance of the underlying resource (or opens it). Sometimes the code block used to create the Resource is non-reusable in which case this Resource can only be used once. This is not recommended. When creating a resource it is recommended to pass the code block for creating the resource to the resource so that the resource can be reused. Of course this is not always possible
This method should only be used with care in cases when Automatic
Resource Management cannot be used because the
InputStream
must be closed manually.
This is public only to permit interoperability with certain Java APIs. A better pattern of use should be:
resource.acquireFor { // call java API }
or
val calculatedResult = resource.acquireAndGet { // cal java API that returns a result }
the actual resource that has been opened
Add a CloseAction to the front of the CloseAction queue.
Add a CloseAction to the front of the CloseAction queue.
The new action to prepend
a new instance with the added CloseAction
Creates a CloseAction from the function and passes it to prependCloseAction(CloseAction)
Creates a CloseAction from the function and passes it to prependCloseAction(CloseAction)
The new action to prepend
a new instance with the added CloseAction
Obtain the ReadableByteChannelResource(typically) version of this object.
Obtain the ReadableByteChannelResource(typically) version of this object.
the ReadableByteChannelResource(typically) version of this object.
Obtain the ReadCharsResource version of this object.
Obtain the ReadCharsResource version of this object.
the ReadCharsResource version of this object.
The number of bytes that can be read from the underlying resource.
The number of bytes that can be read from the underlying resource.
if length == None then it is not possible to determine the number of bytes in advance.
Loads all the characters into memory.
Loads all the characters into memory. There is no protection against loading very large files/amounts of data.
The codec representing the desired encoding of the characters
A ManagedResource for accessing and using ByteChannels. Class can be created using the Resource object.