Record Class ZipEntrySource

java.lang.Object
java.lang.Record
cloud.opencode.base.io.compress.ZipEntrySource
Record Components:
entryName - the entry name inside the archive | 归档内的条目名
inputStream - the data source for this entry | 该条目的数据源
size - declared uncompressed size, or -1 if unknown | 声明的未压缩大小,-1 表示未知

public record ZipEntrySource(String entryName, InputStream inputStream, long size) extends Record
A streaming ZIP entry: name + content stream + optional declared size. 流式 ZIP 条目:名称 + 内容流 + 可选声明大小。

Used by ZipUtil.compressStream(java.io.OutputStream, java.util.List, ZipOptions) to build archives entry-by-entry from arbitrary InputStream sources without staging everything to disk first.

ZipUtil.compressStream(java.io.OutputStream, java.util.List, ZipOptions) 使用本类 由任意 InputStream 源逐条目构建归档,无需先落盘。

Since:
JDK 25, opencode-base-io V1.0.4
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • ZipEntrySource

      public ZipEntrySource(String entryName, InputStream inputStream, long size)
      Creates an instance of a ZipEntrySource record class.
      Parameters:
      entryName - the value for the entryName record component
      inputStream - the value for the inputStream record component
      size - the value for the size record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entryName

      public String entryName()
      Returns the value of the entryName record component.
      Returns:
      the value of the entryName record component
    • inputStream

      public InputStream inputStream()
      Returns the value of the inputStream record component.
      Returns:
      the value of the inputStream record component
    • size

      public long size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component