Package iu.type

Class ComponentEntry

java.lang.Object
iu.type.ComponentEntry
All Implemented Interfaces:
AutoCloseable

class ComponentEntry extends Object implements AutoCloseable
Represents an entry in the component archive.
  • Constructor Details

    • ComponentEntry

      ComponentEntry(String name, InputStream input)
      Constructor use only from ArchiveSource.
      Parameters:
      name - entry name
      input - entry input stream
  • Method Details

    • name

      String name()
      Gets the entry name.
      Returns:
      entry name
    • read

      void read(UnsafeConsumer<InputStream> with)
      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 to data() to throw IllegalStateException.

      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 interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object