Package com.pkgrove.pkgrovekit.storage
Object ContentSource.Companion
-
- All Implemented Interfaces:
public class ContentSource.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static ContentSource.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final static ContentSourceof(ByteArray bytes)In-memory bytes — repeatable by nature. final static ContentSourceof(String text)UTF-8 text — repeatable. final static ContentSourceof(Path file)A file — repeatable; length read per open so it must not change mid-put. final static ContentSourceoneShot(InputStream stream, Long length)A ONE-SHOT stream of known length. -
-
Method Detail
-
of
final static ContentSource of(ByteArray bytes)
In-memory bytes — repeatable by nature. Caller must not mutate bytes.
-
of
final static ContentSource of(String text)
UTF-8 text — repeatable.
-
of
final static ContentSource of(Path file)
A file — repeatable; length read per open so it must not change mid-put.
-
oneShot
final static ContentSource oneShot(InputStream stream, Long length)
A ONE-SHOT stream of known length. Not retry-safe: a second open throws, which the store surfaces as
retrySafe = falserather than corrupting the object with a partial re-send.
-
-
-
-