A Ceylon Destroyable
that adapts an instance of Java's
AutoCloseable
, allowing it to be used as a resource in
the try
construct.
try (inputStream = CeylonDestroyable(FileInputStream(file)) { Integer byte = inputStream.resource.read(); ... }
Note: Since Ceylon 1.2.1 it is possible to use
AutoCloseable
directly in a Ceylon try
statement:
try (inputStream = FileInputStream(file)) { ... }
no subtypes hierarchy
Initializer |
CeylonDestroyable(Resource resource) |
Attributes | |
resource | Source Codeshared Resource resource |
Inherited Attributes |
Attributes inherited from: Object |
Methods | |
destroy | Source Codeshared actual void destroy(Throwable? exception) Destroy this resource. Called when execution of the
body of the Refines Destroyable.destroy |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Destroyable |