Resource class abstract

Acts as a proxy to an actual resource by handling read access.

Implementers

Constructors

Resource()

Properties

file File?
Direct file to this resource, when available.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cached() Resource
Creates a cached resource wrapping this resource.
close() Future<void>
Closes any opened file handles.
length() Future<ResourceTry<int>>
Returns data length from metadata if available, or calculated from reading the bytes otherwise.
Returns the link from which the resource was retrieved.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read({IntRange? range}) Future<ResourceTry<ByteData>>
Reads the bytes at the given range.
readAsJson() Future<ResourceTry<Map<String, dynamic>>>
Reads the full content as a JSON object.
readAsString({String? charset}) Future<ResourceTry<String>>
Reads the full content as a String.
readAsXml() Future<ResourceTry<XmlDocument>>
Reads the full content as an XML document.
toString() String
A string representation of this object.
inherited
use<R>(Future<R> block(Resource resource)) Future<R>
Executes the given block function on this resource and then closes it down correctly whether an exception is thrown or not.

Operators

operator ==(Object other) bool
The equality operator.
inherited