Interface RepeatableContent
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ContentSlice, ImmutableByteContent
Every call to openStream() returns a new sequential reader positioned
at the first byte. Implementations may be backed by files, object storage,
databases or explicitly small immutable byte values. Callers own and must close
each returned stream. Closing the content releases its implementation-owned
resources but does not close streams already returned unless the implementation
documents a stronger local rule.
The contract does not impose an aggregate content-size limit. Completion remains subject to available storage, I/O, technical representability and explicitly injected deployment policy. Content never carries key material or cryptographic provider authority.
-
Method Summary
-
Method Details
-
openStream
Opens a new sequential reader.- Returns:
- newly opened content stream
- Throws:
IOException- if the immutable content cannot be opened or its integrity cannot be established
-
length
OptionalLong length()Returns the known aggregate length when cheaply and authoritatively available.- Returns:
- non-negative length, or empty when the length is unknown
-
contentId
String contentId()Returns a stable, non-secret identifier for integrity and durable provenance.The identifier is metadata, not authorization, and must not expose a temporary physical path.
- Returns:
- stable non-blank identifier
-
close
Releases implementation-owned resources.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if cleanup fails
-