StreamAsset
final class StreamAsset
Extends: Asset
Package: dev.joid.lib.asset.impl · Module: core · Source: StreamAsset.java
An asset read once from an InputStream and kept in memory, so that it can be read again.
Description
Section titled “Description”An InputStream gives one; its id is stream_ followed by a counter, so two streams never share a cache entry.
The first open() reads the stream to its end and closes it; a stream that fails to close only warns.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
StreamAsset | of(InputStream stream) factory | Creates the asset of stream, which is read at the first open(). |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
InputStream | open() | Returns a new stream on the bytes read from the original stream, so that a reload reads the same content. |
Creation details
Section titled “Creation details”StreamAsset of(InputStream stream) factory
Creates the asset of stream, which is read at the first open().
Method details
Section titled “Method details”InputStream open()
Returns a new stream on the bytes read from the original stream, so that a reload reads the same content.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
