Skip to content

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.

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.

ReturnsSignatureSummary
StreamAssetof(InputStream stream) factoryCreates the asset of stream, which is read at the first open().

ReturnsSignatureSummary
InputStreamopen()Returns a new stream on the bytes read from the original stream, so that a reload reads the same content.
Inherited from Asset (6)

getFile · isRemote · peek · read · toString · getUniqueId

StreamAsset of(InputStream stream) factory

Creates the asset of stream, which is read at the first open().

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

Report a problem with this page