java.lang.Object
iu.type.ComponentEntry
- All Implemented Interfaces:
AutoCloseable
Represents an entry in the component archive.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentEntry
(String name, InputStream input) Constructor use only fromArchiveSource
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
(package private) byte[]
data()
Reads and buffers raw data.(package private) String
name()
Gets the entry name.(package private) void
read
(UnsafeConsumer<InputStream> with) Reads raw data from the archive with externally provided logic.toString()
-
Constructor Details
-
ComponentEntry
ComponentEntry(String name, InputStream input) Constructor use only fromArchiveSource
.- Parameters:
name
- entry nameinput
- entry input stream
-
-
Method Details
-
name
String name()Gets the entry name.- Returns:
- entry name
-
read
Reads raw data from the archive with externally provided logic.Either may only be called once, and must not be invoked after
data()
. Will cause subsequent calls todata()
to throwIllegalStateException
.- Parameters:
with
- input handling logic
-
data
byte[] data()Reads and buffers raw data.May be invoked multiple times, but not if
read(UnsafeConsumer)
is invoked first. The result of first invocation will be returned by all subsequent invocations.- Returns:
- raw data
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
toString
-